On 04/25/17 13:10, Viktor Sehr via Boost wrote:
In addition to noncopyable, I sometimes want to force classes to be nonmoveable as well (mainly node-type classes in tree structures which other classes point to). Therefore I'd suggest adding a cousin to noncopyable; boost::nonmoveable which simply prevents an instance to be nonmoveable (as well as noncopyable).
Note; even due the delete modifier were added in C++11 I still think inheriting boost:noncopyable\nonmoveable syntactically nicer than manually marking the copy\move constructors\assignment operators delete.
I think in C++11 noncopyable should be considered deprecated and generally avoided. It affects class hierarchy, adds an extra namespace to ADL and may not be optimized away with EBO. I would even avoid it in C++03 as well. It follows that nonmoveable makes no sense in C++11. Just use the language features you have.