Boost logo

Boost :

From: John Maddock (boost.regex_at_[hidden])
Date: 2003-08-26 05:20:17


>>
> > Thats my point - you may flag some types as safely moveable and then
> > use
> > this knowledge in algorithms. User has the responsibility to do the
> > decision.
>
> Extremely dangerous and error prone. I can't even imagine a non-POD type
> where flagging it for memcpy_copyable and memcpy_moveable can be right.
Can
> you give an example ?
>
> Also, "flagging it" introduces some more complication on the user's part.
> How would you propose the user do this ?

He needs to take a look at the has_trivial_* traits:

has_trivial_assign is roughly equivalent to memcpy_copyable

I guess there is no equivalent to memcpy_moveable: but it looks rather
dangerous, what state is the original object left in afterwards etc? In any
case there is another promising approach to moveable objects proposed for
the next standard
(http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/papers/2002/n1377.htm).

John.


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk