On Wed, Nov 25, 2015 at 7:25 PM, Agustín K-ballo Bergé
On 11/25/2015 12:46 PM, Andrey Semashev wrote:
On 2015-11-25 18:32, Alexander Lauser wrote:
http://en.cppreference.com/w/cpp/language/union have an example that explicitly states what Gavin claimed. Not sure about the reliability of that site, though.
That sounds like self contradiction to me. The page says it's well defined to examine the common subsequence of standard-layout union members but at the same time it's UB to read from them. What's the difference?
The wording is convoluted, maybe it becomes clearer with some examples.
I see, thank you for the clarification. IMHO, the standard should just follow C11 semantics and say it more clearly. Regarding the original topic and the proposed Boost.Config macro for detection of this compiler feature, I'm still not sure we need it, although now I'm not as strongly convinced.