Boost logo

Boost :

From: Anthony Williams (anthwil_at_[hidden])
Date: 2002-09-23 09:31:39


Douglas Gregor writes:
> On Sunday 22 September 2002 10:37 pm, David Abrahams wrote:
> > And finally, what's up with any_pointer? A union with constructors? Ya
> > learn something new every day!
> > That's really weird, though: it's non-POD, yet the compiler can copy it?
> > I guess this is another argument for loosening the restrictions on PODs.
>
> Is it non-POD? 9/4 says:
>
> "...Similarly, a POD-union is an aggregate union that has no nonstatic data
> members of type pointer to member, non-POD-struct, non-POD-union (or array of
> such types) or reference, and has no userdefined copy assignment operator and
> no userdefined destructor."
>
> Doesn't say anything about user-defined constructors, but I'm not a POD-guru.

That's because it is an "aggregate union" --- the definition of an aggregate
precludes constructors.

Anthony


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