[optional] swapping initialized with uninitialized

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

[optional] swapping initialized with uninitialized

Vaclav Vesely

When two optionals (one initialized and other not) are swaped, then the one
value in uninitialized optional is constructed and the other one in
initialized optional is destructed.

IMHO it's not necessary. It should be more effective to swap optional's
m_storages without any values constructiona and destruction.

Is there any reason for the current implementation?


Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost