4 ms·
In C++11 you are supposed to use move semantics in your own classes. I'm not 100% sure but I think the standard require that the STL use move semantics.
by octopus 15y ago
In C++11 you are supposed to use move semantics in your own classes. I'm not 100% sure but I think the standard require that the STL use move semantics.
- cageface 15y agoYes but this is one more thing you have to think about when implementing a class in C++ and one more chance to screw it up. It makes vanilla C and raw pointers look a lot more appealing, to be honest.
- octopus 15y agoActually I think C++11 is a simpler language than C++03 or C++98. The problem is that we need to un-learn what we know and learn the new way of doing things.
- cageface 15y agoC++11 is simpler for the casual user of classes but I'm not so sure it's easier if you're implementing a lot of classes yourself. I disable assignment and copying in all my classes by default unless I have a really good reason to implement them and I still pass by const & for types I define myself.