C++11: reference_wrapper

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… Continue reading C++11: reference_wrapper

Advertisements