220 4870 <CANh-dX=4BbGOaMPzHG2nQw3NScYCWhCGntnyyFA9iiweC2mV6w@mail.gmail.com> article
Path: news.gmane.org!not-for-mail
From: Jeffrey Yasskin <jyasskin@google.com>
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: Re: Re: Proposal: std::sequence
Date: Tue, 4 Jun 2013 17:25:41 -0700
Lines: 28
Approved: news@gmane.org
Message-ID: <CANh-dX=4BbGOaMPzHG2nQw3NScYCWhCGntnyyFA9iiweC2mV6w@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>
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 1370391964 22668 80.91.229.3 (5 Jun 2013 00:26:04 GMT)
X-Complaints-To: usenet@ger.gmane.org
NNTP-Posting-Date: Wed, 5 Jun 2013 00:26:04 +0000 (UTC)
To: std-proposals@isocpp.org
Original-X-From: std-proposals+bncBDDM34EO6QDRBG4LXKGQKGQEHMLCBUA@isocpp.org Wed Jun 05 02:26:05 2013
Return-path: <std-proposals+bncBDDM34EO6QDRBG4LXKGQKGQEHMLCBUA@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-ob0-f200.google.com ([209.85.214.200])
	by plane.gmane.org with esmtp (Exim 4.69)
	(envelope-from <std-proposals+bncBDDM34EO6QDRBG4LXKGQKGQEHMLCBUA@isocpp.org>)
	id 1Uk1YC-00064X-UK
	for gclcip-std-proposals@m.gmane.org; Wed, 05 Jun 2013 02:26:05 +0200
Original-Received: by mail-ob0-f200.google.com with SMTP id eh20sf4525331obb.7
        for <gclcip-std-proposals@m.gmane.org>; Tue, 04 Jun 2013 17:26:04 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=google.com; s=20120113;
        h=x-beenthere:mime-version:in-reply-to:references:from:date
         :message-id:subject: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=Hmo1JpV8oW++0O6XoqbD57tYUPOIOrVcOUQw7yEHFM0=;
        b=oWKm+0B36UZdSWmUvv5EQSM6d0eLZbbgi/6jTGLj7ALTYlbyVeWd0EApdSbi8NJ7az
         UEUI3fdfyzlVBaCVyj7rwk8Sadb8RlRTrAeyxY4w1Pk4/NWxYsx6YXB7u7cfRV54QS5R
         lhDc7nIe5FLPRwLHIDzIqW7epWILczaaa7ccNyyXQysR4/MDPi9GwjHioAqr0/cIVVNk
         v+7nm4BsABhVI2Ird/hZv3zJ06LdrJz0xHkSJPhzGiamYgZXEB1jiVhHV2rkgFgChpZj
         sfAVqSjcbs11lNSayCdmDfd/QzOllMClc/Sd+6GUt0nt0v8JkBuJPuLcft/clP1PkiGu
         8w3Q==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=google.com; s=20120113;
        h=x-beenthere:mime-version:in-reply-to:references:from:date
         :message-id:subject:to:x-gm-message-state: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=Hmo1JpV8oW++0O6XoqbD57tYUPOIOrVcOUQw7yEHFM0=;
        b=lfEsWNfEsZn7viQ2QBS86Zpcjnv1XKQtwngjLRd4NWtp7JvSnIU8Y7YKIfYerwA+nO
         TOIcQwmwDLvUyXWAnyl/bS24RF10QBxi66QrZ+d8sCKdztlbd/fZ0fpybhzpGa3HeE9d
         j+z+PCqOM8T5t8mxIUX6SOaLAT8wy2exa0P4104aqQn7AyMfzIYRGOBwpf7tNPH3wF02
         WlJEMpQFcA02THxFAU/B0LQwrA1EeI8dHNct2+3uioSxvWteH/n/xJBlGHUQcRoqU8gD
         ylG6WMelEM9D6wFQehs3jafkY1GkrIbVLUqprKZfPExbLSN59PYGQc4MiunCDr+tLs8j
         moVw==
X-Received: by 10.182.29.201 with SMTP id m9mr6899245obh.43.1370391963867;
        Tue, 04 Jun 2013 17:26:03 -0700 (PDT)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.182.46.198 with SMTP id x6ls77197obm.93.gmail; Tue, 04 Jun
 2013 17:26:02 -0700 (PDT)
X-Received: by 10.60.44.168 with SMTP id f8mr4470725oem.133.1370391962616;
        Tue, 04 Jun 2013 17:26:02 -0700 (PDT)
Original-Received: from mail-ie0-x22e.google.com (mail-ie0-x22e.google.com [2607:f8b0:4001:c03::22e])
        by mx.google.com with ESMTPS id r7si29158214oej.54.2013.06.04.17.26.02
        for <std-proposals@isocpp.org>
        (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128);
        Tue, 04 Jun 2013 17:26:02 -0700 (PDT)
Received-SPF: pass (google.com: domain of jyasskin@google.com designates 2607:f8b0:4001:c03::22e as permitted sender) client-ip=2607:f8b0:4001:c03::22e;
Original-Received: by mail-ie0-f174.google.com with SMTP id aq17so1944840iec.5
        for <std-proposals@isocpp.org>; Tue, 04 Jun 2013 17:26:02 -0700 (PDT)
X-Received: by 10.50.22.37 with SMTP id a5mr2052110igf.78.1370391962260; Tue,
 04 Jun 2013 17:26:02 -0700 (PDT)
Original-Received: by 10.231.213.69 with HTTP; Tue, 4 Jun 2013 17:25:41 -0700 (PDT)
In-Reply-To: <CAGsORuCy2vonmjfha3XaUge4OKCW_EtheZqspMRfG0cne6uc7A@mail.gmail.com>
X-Gm-Message-State: ALoCoQnimJzqOc7UeN34fIv5XLeM7lDQNDYRTpIgqEvj1E9V2wWPzE8AElwjwAceQEhtxRKqPqvBy7r1lNEUcwlcxyDLwe4Vvyu8+aAZfbx4citAG9BNyJlXN4HNpDYXGB5zKmSjKlwz0plE5Nmh9NBqYqO2ghYWX4CepxdSYpDP6qqXNsU/KXxKuvceZIT6YQ8LAEAiOe8n
X-Original-Sender: jyasskin@google.com
X-Original-Authentication-Results: mx.google.com;       spf=pass (google.com:
 domain of jyasskin@google.com designates 2607:f8b0:4001:c03::22e as permitted
 sender) smtp.mail=jyasskin@google.com;       dkim=pass header.i=@google.com;
       dmarc=pass (p=REJECT dis=none) d=google.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:4870
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/4870>

On Tue, Jun 4, 2013 at 5:17 PM, Zhihao Yuan <lichray@gmail.com> wrote:
> On Tue, Jun 4, 2013 at 7:26 PM, Jeffrey Yasskin <jyasskin@google.com> wrote:
>> const array_ref<int> carr2 = ...;
>> do_stuff_with(carr2);
>> use(carr2.size());
>>
>> the compiler _can_ assume carr.size() is the same.
>
> In a general case, since the same memory can be referred
> by another pointer or reference, optimizers just won't analysis
> the data flow.  Instead, they know many thing about the control
> flow.  If the above code is optimized, that means you don't
> have the code to change the size; it doesn't matter you declare
> it as const or not.

See "The only time const might allow optimizations" in the very
article you linked to.

-- 

--- 
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.



.
