[boost] Re: memcpy_copyable and memcpy_moveable type traits

2003-08-26 Thread Edward Diener
Pavel Vozenilek wrote: David Abrahams [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] ... I don't believe you can use memcpy to move any non-POD types portably, i.e. without special knowledge of the compiler. Thats my point - you may flag some types as safely moveable and then

[boost] Re: memcpy_copyable and memcpy_moveable type traits

2003-08-26 Thread Pavel Vozenilek
Edward Diener [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] 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 ? It is error prone but many other constructs are

Re: [boost] Re: memcpy_copyable and memcpy_moveable type traits

2003-08-26 Thread John Maddock
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

Re: [boost] Re: memcpy_copyable and memcpy_moveable type traits

2003-08-26 Thread John Maddock
see boost::is_POD. And has_trivial_copy has_trivial_assign has_trivial_destruct etc John. ___ Unsubscribe other changes: http://lists.boost.org/mailman/listinfo.cgi/boost

[boost] Re: memcpy_copyable and memcpy_moveable type traits

2003-08-26 Thread Edward Diener
Pavel Vozenilek wrote: Edward Diener [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] 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 ? It is error prone but

Re: [boost] Re: memcpy_copyable and memcpy_moveable type traits

2003-08-26 Thread Peter Dimov
John Maddock wrote: 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

[boost] Re: memcpy_copyable and memcpy_moveable type traits

2003-08-26 Thread David Abrahams
Peter Dimov [EMAIL PROTECTED] writes: I guess there is no equivalent to memcpy_moveable: but it looks rather dangerous, what state is the original object left in afterwards etc? None. There is no original object after the move, only raw storage. ...which is a different meaning from move in

Re: [boost] Re: memcpy_copyable and memcpy_moveable type traits

2003-08-26 Thread Peter Dimov
David Abrahams wrote: Peter Dimov [EMAIL PROTECTED] writes: I guess there is no equivalent to memcpy_moveable: but it looks rather dangerous, what state is the original object left in afterwards etc? None. There is no original object after the move, only raw storage. ...which is a

[boost] Re: memcpy_copyable and memcpy_moveable type traits

2003-08-26 Thread Pavel Vozenilek
Edward Diener [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] ... But even for a POD type such as this, copying would lead to errors if the char * data were dynamically allocated since a double delete would probably be done. Containers aware of memcpy_moveable can detect this flag

[boost] Re: memcpy_copyable and memcpy_moveable type traits

2003-08-26 Thread Pavel Vozenilek
Edward Diener [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] ... But even for a POD type such as this, copying would lead to errors if the char * data were dynamically allocated since a double delete would probably be done. Containers aware of memcpy_moveable can detect this flag

[boost] Re: memcpy_copyable and memcpy_moveable type traits

2003-08-25 Thread Pavel Vozenilek
David Abrahams [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Pavel Vozenilek [EMAIL PROTECTED] writes: Type traits library may be extended with: - memcpy_copyable and - memcpy_moveable see boost::is_POD. memcpy_moveable may be useful for non-POD types, like some pimpls.

[boost] Re: memcpy_copyable and memcpy_moveable type traits

2003-08-25 Thread David Abrahams
Pavel Vozenilek [EMAIL PROTECTED] writes: David Abrahams [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Pavel Vozenilek [EMAIL PROTECTED] writes: Type traits library may be extended with: - memcpy_copyable and - memcpy_moveable see boost::is_POD. memcpy_moveable may be

[boost] Re: memcpy_copyable and memcpy_moveable type traits

2003-08-25 Thread Pavel Vozenilek
David Abrahams [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] ... I don't believe you can use memcpy to move any non-POD types portably, i.e. without special knowledge of the compiler. Thats my point - you may flag some types as safely moveable and then use this knowledge in