Boost logo

Boost :

Subject: Re: [boost] [TypeIndex] Peer review period for library acceptance begins, ending Thurs 21st Nov
From: Steven Watanabe (watanabesj_at_[hidden])
Date: 2013-11-15 18:40:54


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<int32_t>(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


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk