|
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
> http://gcc.gnu.org/projects/cxx0x.html
>
> The macro might be named BOOST_NO_UNRESTRICTED_UNIONS.
>
> See http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2544.pdf
>
> 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
# if defined(BOOST_NO_DEFAULTED_FUNCTIONS) &&
defined(BOOST_ENDIAN_FORCE_PODNESS)
# define BOOST_ENDIAN_NO_CTORS
# 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
BOOST_NO_DEFAULTED_FUNCTIONS in this case?
> 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.
Best,
Vicente
-- View this message in context: http://boost.2283326.n4.nabble.com/config-C-0X-Compiler-doesn-t-support-classes-with-constructors-in-unions-tp3320143p3321220.html Sent from the Boost - Dev mailing list archive at Nabble.com.
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk