5 ms·
The problem with move semantics is that people don't understand its fallback mechanism, - (that is if it can't move an object and there is not restriction mecha
by stephen82 5y ago
The problem with move semantics is that people don't understand its fallback mechanism, - (that is if it can't move an object and there is not restriction mechanism in a constructor) - it will be used as a copy constructor which is expensive.
I will advice you to read Nicolai Josuttis' " C++ Move Semantics - The Complete Guide" [1] which describes in great detail all the tips and tricks around move semantics.
P.S.: For any C++ developer out there, in my humble opinion anything written by Nicolai Josuttis is a must-read!
[1] http://www.cppmove.com/ http://www.cppmove.com/
- midjji 5y agoThanks, that did help. I still cant get around when the standard made mistakes though -_-'but I suspect most of it might be compiler fixable. Pity clang does not allow more inlining control, its been the fix for too many gcc clang perf differences that I've seen.