user1658476
user1658476

Reputation: 151

When to use std::forward<F>(f)(...) instead of f(...)

Suppose we have following methods A and B. What is the correct way of invoking "f" and why?

template<class F> auto A(F&& f) { std::forward<F>(f)(...);  }

template<class F> auto B(F&& f) { f(...);  }

Upvotes: 1

Views: 43

Answers (0)

Related Questions