From: Douglas Gregor (gregod_at_[hidden])
Date: 2002-09-23 08:45:16
On Sunday 22 September 2002 10:37 pm, David Abrahams wrote:
> Then I have to ask, why bother with is_stateless?
> Why not check to see if the function object:
> a. has alignment compatible with the function object
> b. has size <= sizeof(any_pointer)
> c. has_trivial_copy_constructor
A while back, we discussed replacing is_stateless with a & b, and that ran
into the same problems as Variant with the need for move semantics. But your
formulation doesn't have those problems, and we should go with it.
Post-1.29.0, that is :)
> 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.
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk