
Giovanni Piero Deretta wrote:
On 11/30/08, Ion Gaztañaga <igaztanaga@gmail.com> wrote:
Jan Stetka wrote:
I'm don't known what "move semantics" are, my motive is so I can have named_mutex and managed_shared_memory in the global scope without having to instantiate as pointers. In other words, you want to create a default-constructed type and then swap it with a named constructed one when you have enough data to build a named object?
IMHO for this purpose boost.optional + inplace factory is the best solution.
Yes, this is a good solution. However, some prefer having a default constructed state (that only can be modified through swapping or move semantics), since you already need it to implement a private "default-constructed state" to correctly implement the destructor. Regards, Ion