|
Boost : |
From: Stephan Tolksdorf (andorxor_at_[hidden])
Date: 2008-02-26 11:00:20
Martin Bonner wrote:
>> Interesting, but I wouldn't do this without the approval of a
>> pedantic langauge lawyer.
>> I have been bitten by this sort of things in the past.
>> And I'm not sure it would make things faster on Visual Studio anyway.
>
> I'm not sure I'm a pedantic language lawyer, but the standard says "In a
> union, at most one of the data members can be active at any time". It is quite
> clear that experts in CLC++M regard John Maddock's version of setbits and
> getbits as undefined behaviour. In general, I would regard using undefined
> behaviour as unacceptable for a boost library.
Does anyone know a modern C++ compiler where aliasing through a union doesn't work?
Best regards,
Stephan
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk