mirror of
https://github.com/isocpp/CppCoreGuidelines.git
synced 2024-03-22 13:30:58 +08:00
Fixed invoke() example to not forward the functor, to reflect other discussion
This commit is contained in:
parent
ac773e44d4
commit
247be64de6
|
@ -2347,8 +2347,8 @@ In that case, and only that case, make the parameter `TP&&` where `TP` is a temp
|
||||||
##### Example
|
##### Example
|
||||||
|
|
||||||
template <class F, class... Args>
|
template <class F, class... Args>
|
||||||
inline auto invoke(F&& f, Args&&... args) {
|
inline auto invoke(F f, Args&&... args) {
|
||||||
return forward<F>(f)(forward<Args>(args)...);
|
return f(forward<Args>(args)...);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user