I\'ve been thinking about storing C++ lambda\'s lately. The standard advice you see on the Internet is to store the lambda in a std::function object. However, none of this adv
I noticed the same performance problem a while ago with MSVC10 and filed a bug report at microsoft connect :
https://connect.microsoft.com/VisualStudio/feedback/details/649268/std-bind-and-std-function-generate-a-crazy-number-of-copy#details
The bug is closed as "fixed". With MSVC11 developer preview your code now indeed print :
Constructing simple!
Copying simple!
Moving simple!
Destroying simple!
5
Destroying simple!
Destroying simple!