[optional] swap initialized with uninitialized

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

[optional] swap initialized with uninitialized

Vaclav Vesely
Hi,

When two optionals are swaped and only one is initialized, then wrapped
value in the uninitialized optional is constructed and that in initialized
one is destroyed. It's maybe not necessary. It should be sufficient and more
effective to swap optional_base's member (m_initialized and m_storage). Is
there any reason for this implementation?

Regards,
Vaclav



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