Closed bogdanm closed 8 years ago
@bremoran @0xc0170
Updated with move copy constructor/assignment operator and =delete
@bremoran @0xc0170
Do we want them to be private? A compiler issues an additional error that they are not accessible (besides "use of delete function").
// private + delete
In function 'int main()':
10:5: error: 'Test::Test(const Test&)' is private
16:10: error: within this context
16:10: error: use of deleted function 'Test::Test(const Test&)' 10:5: note: declared here
//public + delete
In function 'int main()':
15:10: error: use of deleted function 'Test::Test(const Test&)'
9:5: note: declared here
LGTM
I honestly have no idea if it's better to keep them private rather than public or the other way around.
I'd say that one compiler error is better than two. I also like the =delete syntax. However, I think that we should pick one: either private or = delete, not both.
Ok, deleted operators and constructors are public now. Can we merge this?
LGTM
+1
The core-util allocators (PoolAllocator, ExtendablePoolAllocator, Array and BinaryHeap) don't have well defined copy semantics, thus it's better to explicitly forbid copying than to rely on the copy constructors and assignment operators generated automatically by the compiler.
Fixes #11.