Boost logo

Boost :

From: Daryle Walker (darylew_at_[hidden])
Date: 2006-07-29 10:56:42


On 7/27/06 6:50 PM, "loufoque" <mathias.gaunard_at_[hidden]> wrote:

> Dave Dribin wrote :
>
>> And this has a workaround by using a for loop.
>
> Not really.
> std::vector, just like a lot of elements from the C++ standard library,
> require that the types are CopyConstructible.
> And if endian types are, they're not PODs anymore.

Why would being copy-constructible forbid POD-ness? Obviously, adding a
copy constructor to a class/struct/union would disqualify it from being POD.
But that's not the only way to define copying. The automatic copy
constructor does _not_ cancel POD qualification, since is a dumb bitwise
copy for PODs, and should still count as copy-constructible as far as STL is
concerned. (If an explicit copy construction operation actually is
required, then the concept is broken. It not like you can improperly use a
constructor by getting its member-function address.)

-- 
Daryle Walker
Mac, Internet, and Video Game Junkie
darylew AT hotmail DOT com

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