2017-04-06 14:47 GMT+02:00 Kai Tietz <ktiet...@googlemail.com>:
> 2017-04-06 13:38 GMT+02:00 Norbert Pfeiler
> <norbert.pfeiler+mingw-...@gmail.com>:
>> I’m pretty sure that cast via union is UB in C++ whereas C-style casting
>> away constness isn’t (only writing to the resulting object would be) but it
>> may result in compilers issuing warnings about style (because C++ has
>> const_cast).

Hmm, undefined behavior???  no, this is pretty well defined behavior.
In C++ world a union cast is pretty much the same as a
reinterpret_cast (or a C style cast without conversion operator).  And
a const_cast is just a smaller set out of the realm of
reinterpret_cast.

Cheers,
Kai

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Mingw-w64-public mailing list
Mingw-w64-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public

Reply via email to