| Start |
|---|
| Factory functions Suppose we want to write a factory function that accepts an arbitrary list of arguments and passes those arguments unmodified to another function. An example of such a function is The language rules regarding variadic templates and rvalue references allows us to write such a function. The use of ellipses RemarksPerfect forwarding requires forwarding references in order to preserve the ref-qualifiers of the arguments. Such references appear only in a deduced context. That is: The following does not involve perfect forwarding, because C++17 will allow deduction of class template arguments. The constructor of "a" in the above example will become a user of a forwarding reference |
Read Article
https://develop.horje.com/learn/1434/reference