Boost logo

Boost :

Subject: Re: [boost] [config] C++0X Compiler doesn't support classes with constructors in unions
From: Vicente Botet (vicente.botet_at_[hidden])
Date: 2011-02-23 10:48:37

Beman Dawes wrote:
> On Tue, Feb 22, 2011 at 5:06 PM, Vicente Botet
> <vicente.botet_at_[hidden]>wrote:
>> Hi,
>> is there a macro that can be tested to know if a compiler doesn't support
>> classes with constructors in unions?
> No, and GCC 4.6 is supporting them. See
> The macro might be named BOOST_NO_UNRESTRICTED_UNIONS.
> See
> Do you have an actual need for such a macro? We only want to add macros
> that
> will be actually used by Boost libraries.

I was testing your Endian library and the macro used to know if constructors
shouldn't be used for the endian class is up to now

# endif

I tested with gcc 4.4/4.5.1 c++0x with BOOST_ENDIAN_FORCE_PODNESS defined
and the union test fails.

This should mean that for these versions BOOST_NO_DEFAULTED_FUNCTIONS is
not defined so the constructors are defined.

Shouldn't you use BOOST_NO_UNRESTRICTED_UNIONS instead of

> If you do have a need, would you like to try your hand at providing the
> macro, test cases, docs, etc?

Yes, I know the process :). Unfortunately I don't have access to gcc 4.6 now
(my hard drive was broken :( ), so I can not test it now. I will see once I
reach to reinstall a 4.6 version on my new computer.


View this message in context:
Sent from the Boost - Dev mailing list archive at

Boost list run by bdawes at, gregod at, cpdaniel at, john at