Quantcast
Channel: Cpp11 – On C++ and other OOPscenities
Viewing all articles
Browse latest Browse all 23

C++11: reference_wrapper

$
0
0
Look at this piece of code: This program supposedly adds 80 to 20 and prints the result; it compiles perfectly but when you execute it; you get…. 0! Why? Because the bind method receives its parameters as parameters-by-value and the “result” variable is copied before being passed to the bound function add. Why? Because bind […]

Viewing all articles
Browse latest Browse all 23

Trending Articles