220 4876 <CAGsORuDcF35cyHfM-_bPeSaon80SOD=i7aBmvZo1-rThnVJVPg@mail.gmail.com> article
Path: news.gmane.org!not-for-mail
From: Zhihao Yuan <lichray@gmail.com>
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: Re: Re: Proposal: std::sequence
Date: Tue, 4 Jun 2013 21:23:55 -0400
Lines: 39
Approved: news@gmane.org
Message-ID: <CAGsORuDcF35cyHfM-_bPeSaon80SOD=i7aBmvZo1-rThnVJVPg@mail.gmail.com>
References: <4551abbc-43aa-4520-a91a-f8eb25a90588@isocpp.org>
	<e915df62-4930-48ee-a8ac-64261c407234@isocpp.org>
	<2c8e6079-9c87-425a-93e2-39251df57cd8@isocpp.org>
	<CANh-dX=va9uLSbvQc_TRmf8o5TDzQutmkxJDc64g7b=yKyN7sg@mail.gmail.com>
	<9f1cace3-0503-4a3c-a8ce-d7546564b3ef@isocpp.org>
	<a6f024b6-45d6-4c3b-b8a6-3f056aeab51f@isocpp.org>
	<c029551c-241c-4809-adaa-7908434ba10d@isocpp.org>
	<ed3c548d-b470-47ec-850e-95d3c11e29a8@isocpp.org>
	<1c991e6e-6bc3-4822-9ffd-7f2508e63974@isocpp.org>
	<CADfx-VTw0ArZ3+JbD=Vv+o9ncwNp9miYy5RD9XXeOFGEE3N0MQ@mail.gmail.com>
	<etPan.51ae6e0b.238e1f29.8d5@server-2.private>
	<CANh-dX=zKENwN_sS84HHOuzeug0NqDiJ0w4D8FtEWFYYhMbfAg@mail.gmail.com>
	<CAGsORuBjtg1GO4ink+yS6Gy6ZsmBr2EO3Ax46uOMVRKTZat=pQ@mail.gmail.com>
	<CANh-dXm9u+Sd_k+Ld19PpYBzTo-VM_Ur32wxKxk3DJcCiUKdng@mail.gmail.com>
	<CAGsORuCy2vonmjfha3XaUge4OKCW_EtheZqspMRfG0cne6uc7A@mail.gmail.com>
	<CANh-dX=4BbGOaMPzHG2nQw3NScYCWhCGntnyyFA9iiweC2mV6w@mail.gmail.com>
	<CAGsORuANw6cgQYKSxJhKAEd8F+8_=ObHJcnE33OPLYs7dCYsUw@mail.gmail.com>
	<CAGg_6+NQ_zDUZrfcwEBKcCUXs=vtF4q6dkU527BNEKAbW0tW+Q@mail.gmail.com>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: plane.gmane.org
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
X-Trace: ger.gmane.org 1370395436 21450 80.91.229.3 (5 Jun 2013 01:23:56 GMT)
X-Complaints-To: usenet@ger.gmane.org
NNTP-Posting-Date: Wed, 5 Jun 2013 01:23:56 +0000 (UTC)
To: "std-proposals@isocpp.org" <std-proposals@isocpp.org>
Original-X-From: std-proposals+bncBCUILMGRQMARBLFGXKGQKGQE2WFIC7I@isocpp.org Wed Jun 05 03:23:57 2013
Return-path: <std-proposals+bncBCUILMGRQMARBLFGXKGQKGQE2WFIC7I@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-wg0-f69.google.com ([74.125.82.69])
	by plane.gmane.org with esmtp (Exim 4.69)
	(envelope-from <std-proposals+bncBCUILMGRQMARBLFGXKGQKGQE2WFIC7I@isocpp.org>)
	id 1Uk2SD-0006U3-35
	for gclcip-std-proposals@m.gmane.org; Wed, 05 Jun 2013 03:23:57 +0200
Original-Received: by mail-wg0-f69.google.com with SMTP id j13sf884905wgh.0
        for <gclcip-std-proposals@m.gmane.org>; Tue, 04 Jun 2013 18:23:56 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20120113;
        h=x-beenthere:mime-version:in-reply-to:references:date:message-id
         :subject:from:to:x-original-sender:x-original-authentication-results
         :reply-to:precedence:mailing-list:list-id:x-google-group-id
         :list-post:list-help:list-archive:list-subscribe:list-unsubscribe
         :content-type;
        bh=Pbl78lTxzBkS9nALpgPT6gtntLFL3r5CX9jBeFmf+PQ=;
        b=s6hsBOSuT3zS5dooNGqk0oO67OP9S0qQpcXj05cfZrOovvTepmGx+8+5qC4X3dNSwJ
         3joVcIybBwSPfPgVyAt2wPZg4KCA2aW/EZPKh55U2hcGAh5+kvxpP2xrQexQ+22z4zio
         D9YtX7BUt6OR+bHpwr9uQl6edbu9brzFzAen8o9yHqxitQ0B3gXQT1qzYv7EhXsfpIs7
         c8qMooCssYh1z48Ps2pfpYN2QrgtGgwEhv5A1lSjZTtCR8Acs3rd4u54YIwxITQOg4+H
         AJlMWDy1o0t5dNCvqLK0rdjO82K6VCOOqn2LLliYyJF59jIX5LLOT1dt9b8+wrF4su8P
         yERA==
X-Received: by 10.112.74.82 with SMTP id r18mr4536591lbv.4.1370395436745;
        Tue, 04 Jun 2013 18:23:56 -0700 (PDT)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.152.43.198 with SMTP id y6ls33919lal.38.gmail; Tue, 04 Jun
 2013 18:23:55 -0700 (PDT)
X-Received: by 10.112.60.8 with SMTP id d8mr14079426lbr.39.1370395435800;
        Tue, 04 Jun 2013 18:23:55 -0700 (PDT)
Original-Received: from mail-la0-x229.google.com (mail-la0-x229.google.com [2a00:1450:4010:c03::229])
        by mx.google.com with ESMTPS id lj8si18016994lab.124.2013.06.04.18.23.55
        for <std-proposals@isocpp.org>
        (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128);
        Tue, 04 Jun 2013 18:23:55 -0700 (PDT)
Received-SPF: pass (google.com: domain of lichray@gmail.com designates 2a00:1450:4010:c03::229 as permitted sender) client-ip=2a00:1450:4010:c03::229;
Original-Received: by mail-la0-f41.google.com with SMTP id fn20so898284lab.14
        for <std-proposals@isocpp.org>; Tue, 04 Jun 2013 18:23:55 -0700 (PDT)
X-Received: by 10.112.60.195 with SMTP id j3mr13786123lbr.37.1370395435618;
 Tue, 04 Jun 2013 18:23:55 -0700 (PDT)
Original-Received: by 10.112.146.99 with HTTP; Tue, 4 Jun 2013 18:23:55 -0700 (PDT)
In-Reply-To: <CAGg_6+NQ_zDUZrfcwEBKcCUXs=vtF4q6dkU527BNEKAbW0tW+Q@mail.gmail.com>
X-Original-Sender: lichray@gmail.com
X-Original-Authentication-Results: mx.google.com;       spf=pass (google.com:
 domain of lichray@gmail.com designates 2a00:1450:4010:c03::229 as permitted
 sender) smtp.mail=lichray@gmail.com;       dkim=pass header.i=@gmail.com
Precedence: list
Mailing-list: list std-proposals@isocpp.org; contact std-proposals+owners@isocpp.org
List-ID: <std-proposals.isocpp.org>
X-Google-Group-Id: 399137483710
List-Post: <http://groups.google.com/a/isocpp.org/group/std-proposals/post?hl=en>,
 <mailto:std-proposals@isocpp.org>
List-Help: <http://support.google.com/a/isocpp.org/bin/topic.py?hl=en&topic=25838>,
 <mailto:std-proposals+help@isocpp.org>
List-Archive: <http://groups.google.com/a/isocpp.org/group/std-proposals/?hl=en>
List-Subscribe: <http://groups.google.com/a/isocpp.org/group/std-proposals/subscribe?hl=en>,
 <mailto:std-proposals+subscribe@isocpp.org>
List-Unsubscribe: <http://groups.google.com/a/isocpp.org/group/std-proposals/subscribe?hl=en>,
 <mailto:googlegroups-manage+399137483710+unsubscribe@googlegroups.com>
Xref: news.gmane.org gmane.comp.lang.c++.isocpp.proposals:4876
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/4876>

On Tue, Jun 4, 2013 at 9:11 PM, Nevin Liber <nevin@eviloverlord.com> wrote:
> On 4 June 2013 20:06, Zhihao Yuan <lichray@gmail.com> wrote:
>>
>> int main() {
>>     A a;
>>     f((int*)&a);
>>     std::cout << a.x;
>> }
>>
>> Then you will find that the 'optimization' no longer works.
>>
>
> You are invoking undefined behavior, so whether or not the optimization
> works in this case is irrelevant.

Oh, typo, sorry.  You mean strict aliasing.

Should be

    A a;
    f((int*)&a.x);
    std::cout << a.x;

--
Zhihao Yuan, ID lichray
The best way to predict the future is to invent it.
___________________________________________________
4BSD -- http://4bsd.biz/

-- 

--- 
You received this message because you are subscribed to the Google Groups "ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an email to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposals/?hl=en.



.
