Boost logo

Boost :

Subject: Re: [boost] [config] C++0X Compiler doesn't support classes with constructors in unions
From: Stewart, Robert (Robert.Stewart_at_[hidden])
Date: 2011-02-23 07:20:37


Nevin Liber wrote:
> On 22 February 2011 16:06, Vicente Botet
> <vicente.botet_at_[hidden]> wrote:
>
> > is there a macro that can be tested to know if a compiler
> > doesn't support classes with constructors in unions?
> >
>
> What compiler(s) implement this as an extension?

It isn't an extension but a feature of C++0x.

> It isn't allowed in C++03 either: "An object of a class with a
> non-trivial constructor, a non-trivial copy constructor, a
> non-trivial destructor, or a non-trivial copy assignment
> operator cannot be a member of a union, nor can an array of
> such objects."

That restriction no longer applies in C++0x.

_____
Rob Stewart robert.stewart_at_[hidden]
Software Engineer, Core Software using std::disclaimer;
Susquehanna International Group, LLP http://www.sig.com

IMPORTANT: The information contained in this email and/or its attachments is confidential. If you are not the intended recipient, please notify the sender immediately by reply and immediately delete this message and all its attachments. Any review, use, reproduction, disclosure or dissemination of this message or any attachment by an unintended recipient is strictly prohibited. Neither this message nor any attachment is intended as or should be construed as an offer, solicitation or recommendation to buy or sell any security or other financial instrument. Neither the sender, his or her employer nor any of their respective affiliates makes any warranties as to the completeness or accuracy of any of the information contained herein or that this message or any of its attachments is free of viruses.


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