potswa / cxx_function

Prototype for new std::function features, compatible with C++11.
MIT License
46 stars 7 forks source link

Trivialize moving of std::allocator targets #5

Closed potswa closed 9 years ago

potswa commented 9 years ago

libc++'s move constructor avoids the indirect call for allocated targets.

This library doesn't because of support for fancy pointers and nontrivial allocator destructors. The wrapper should be able to handle moves, absent those corner cases.

The behavior could be selected by a new vtable slot, or something besides a valid function pointer or nullptr in the move_constructor_destructor slot.