Perfect Forwarding
Pass arguments through a template keeping their value category, using `T&&` + `std::forward<T>`.
Advanced
template <class... Args>
auto make(Args&&... a) { return T(std::forward<Args>(a)...); }
Spotted a mistake or want to add detail? Suggest an improvement — Content Contributors' edits are reviewed by editors before they go live.
Discussion (0)
Sign in or join free to ask questions and discuss this topic.