August 2012
Intermediate to advanced
976 pages
30h 17m
English
Some functions need to forward one or more of their arguments with their types unchanged to another, forwarded-to, function. In such cases, we need to preserve everything about the forwarded arguments, including whether or not the argument type is const, and whether the argument is an lvalue or an rvalue.
As an example, we’ll write a function that takes a callable expression and two additional arguments. Our function will call the given callable with the other two arguments in reverse order. The following is a first cut at our flip function:
// template that takes a callable and two parameters// and calls the given callable ...
Read now
Unlock full access