moya-lang/Allocator

Move constructor and move assignment operator

ibogosavljevic opened this issue · 2 comments

I really miss move constructor and move assignment operator (they've been deleted). My code has something like this:

class my_class {
Moya::MemoryPool poo;
};

my_class create() {
my_class m;
...
return m;
}

my_class x = create(); // This doesn't compile because move constructor is deleted.

Can you fix it?

Same Problem with Google Test and Google Benchmark

The move constructor and move assignment operator are deleted on purpose. It is not intended to use it in the way you presented. Instead, the class should be specified as a template parameter to std containers as described in the example on ReadMe.md (like: std::list<int, Allocator<int, 16 * 1024>> list3;). I leave this commend opened. Please let me know if there is a real need for doing it as you described so I can rethink the design. Thanks for commenting.