
15 Nov
2013
15 Nov
'13
11:40 p.m.
AMDG On 11/15/2013 01:48 PM, Niall Douglas wrote:
On 15 Nov 2013 at 17:50, Antony Polukhin wrote:
<snip> int64_t i64 = 1; foo(i64, reinterpret_cast
(i64)); // outputs 1 But this error appears only when we mutate data ( https://svn.boost.org/trac/boost/wiki/Guidelines/WarningsGuidelines search for "strict-aliasing rules")
This isn't really the same thing as Stephen mentioned.
In all essentials, it is the same. The precise rule that it violates is different, but it's still forbidden. "If a non-static member function of a class X is called for an object that is not of type X, or of a type derived from X, the behavior is undefined" (C++11 9.3.1 [class.mfct.non-static]) In Christ, Steven Watanabe