Aug 29, 2012

[c++11] Perfect forwarding an't that perfect.


Perfect forwarding isn’t really perfect. There are several kinds of arguments that cannot be perfectly forwarded, including (but not necessarily limited to):

• 0 as a null pointer constant.
• Names of function templates (e.g., std::endl and other manipulators).
• Braced initializer lists.
• In-class initialized const static data members lacking an out-of-class definition.
•Bit fields.

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.