2 ms·
These days I am writing a lot of C++11 code. I find that I write two different kinds of objects: 1. copyable objects like class RGB { int r, g, b }; 2.
by maxs 12y ago
These days I am writing a lot of C++11 code. I find that I write two different kinds of objects:
1. copyable objects like
class RGB { int r, g, b };
2. big complex things that should never copy but can move
class Foo { Foo(const Foo&) = delete; };
In case of (1), I don't care if move or copy constructors are used and I am happy that the compiler will decide. In case of (2), if by accident I invoke a copy constructor, I end up getting a compile-time error.