220 4872 <e4d444a8-e195-4038-9d21-2d29b94305fe@isocpp.org> article
Path: news.gmane.org!not-for-mail
From: carrierandoperator@yahoo.co.uk
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: Re: Re: Proposal: std::sequence
Date: Tue, 4 Jun 2013 17:52:16 -0700 (PDT)
Lines: 157
Approved: news@gmane.org
Message-ID: <e4d444a8-e195-4038-9d21-2d29b94305fe@isocpp.org>
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>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: plane.gmane.org
Mime-Version: 1.0
Content-Type: multipart/alternative; 
	boundary="----=_Part_929_15563790.1370393536677"
X-Trace: ger.gmane.org 1370393539 4597 80.91.229.3 (5 Jun 2013 00:52:19 GMT)
X-Complaints-To: usenet@ger.gmane.org
NNTP-Posting-Date: Wed, 5 Jun 2013 00:52:19 +0000 (UTC)
To: std-proposals@isocpp.org
Original-X-From: std-proposals+bncBDQ2R4E5RIKBBQMXXKGQKGQETFL5BIQ@isocpp.org Wed Jun 05 02:52:20 2013
Return-path: <std-proposals+bncBDQ2R4E5RIKBBQMXXKGQKGQETFL5BIQ@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-gh0-f198.google.com ([209.85.160.198])
	by plane.gmane.org with esmtp (Exim 4.69)
	(envelope-from <std-proposals+bncBDQ2R4E5RIKBBQMXXKGQKGQETFL5BIQ@isocpp.org>)
	id 1Uk1xb-0008MT-5Z
	for gclcip-std-proposals@m.gmane.org; Wed, 05 Jun 2013 02:52:19 +0200
Original-Received: by mail-gh0-f198.google.com with SMTP id r13sf398877ghr.9
        for <gclcip-std-proposals@m.gmane.org>; Tue, 04 Jun 2013 17:52:18 -0700 (PDT)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=google.com; s=20120113;
        h=x-beenthere:date:from:to:message-id:in-reply-to:references:subject
         :mime-version:x-original-sender:reply-to:precedence:mailing-list
         :list-id:x-google-group-id:list-post:list-help:list-archive
         :list-subscribe:list-unsubscribe:content-type;
        bh=v6njFmMjwbt5WNp5GTL9Loe0nlVjbD4WDUfESDbB+HE=;
        b=UY515LTkb5Cd6uU9Zi1DVSu6hAOA3FAn5K2FacT5+5N3jEpi5dq846MjaktbQBd4E0
         xCnZyqK6zefHbIf263w+xEUvkQG/oXnIC3cAl336UqtJuga+fQZIENiiexoBmiba6wI2
         yGnQHAFG3Al6YmrweH77dAS7yAiMCZGwu65fNgBfd9Xb1RoeuDUSBU3mOQZ79cRJCByQ
         gfQmIS+lp8JZS/bj6e9Xq7457WqTIIua8/zpW8FA9aOU4OZKVs8GNKhG6XXeaJpy2bnH
         EiCPTI9q8mbhAybjkB3s67E9xrXLqP6BNFLOmyT4gen7dJljuPPVLaFtAIjJ+mOeIq2D
         zPtw==
X-Received: by 10.224.205.138 with SMTP id fq10mr17684628qab.1.1370393538222;
        Tue, 04 Jun 2013 17:52:18 -0700 (PDT)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.49.48.201 with SMTP id o9ls573631qen.30.gmail; Tue, 04 Jun
 2013 17:52:17 -0700 (PDT)
X-Received: by 10.49.2.228 with SMTP id 4mr2251748qex.3.1370393537011;
        Tue, 04 Jun 2013 17:52:17 -0700 (PDT)
In-Reply-To: <CANh-dX=zKENwN_sS84HHOuzeug0NqDiJ0w4D8FtEWFYYhMbfAg@mail.gmail.com>
X-Original-Sender: carrierandoperator@yahoo.co.uk
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:4872
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/4872>

------=_Part_929_15563790.1370393536677
Content-Type: text/plain; charset=ISO-8859-1

On Tuesday, June 4, 2013 6:54:45 PM UTC-4, Jeffrey Yasskin wrote:
>
> <snip>
>
> Yeah, you might see a performance difference for non-const 
> array_ref<>s where the compiler can't assume they don't change. If 
> users see that, they can create const array_ref<>s instead. Is there a 
> difference between const array_ref<>s and sequence<>s? 
>

Mentioning an update past the initial proposal; there are two forms:

template<>class sequence {const T* const element; const size_t size;}; // 
for immutable elements
template<>class mutable_sequence {T* const element; const size_t size;}; // 
for mutable elements


Thus:
const array_ref<int>
sequence<int>
sequence<int>&
const sequence<int>
const sequence<int>&
const mutable_sequence<int>
const mutable_sequence<int>&


All specify objects which have invariant size and pointer. In all cases, 
mutable elements may not be provided by the class although they may be 
externally modified.

Naturally, there will also be cases where the optimizer can prove a value 
of type array_ref<int> does not alter its size or pointer.

 (excuse the edit noise)

-- 

--- 
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.



------=_Part_929_15563790.1370393536677
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

On Tuesday, June 4, 2013 6:54:45 PM UTC-4, Jeffrey Yasskin wrote:<blockquot=
e class=3D"gmail_quote" style=3D"margin: 0;margin-left: 0.8ex;border-left: =
1px #ccc solid;padding-left: 1ex;">&lt;snip&gt;<br>
<br>Yeah, you might see a performance difference for non-const
<br>array_ref&lt;&gt;s where the compiler can't assume they don't change. I=
f
<br>users see that, they can create const array_ref&lt;&gt;s instead. Is th=
ere a
<br>difference between const array_ref&lt;&gt;s and sequence&lt;&gt;s?
<br></blockquote><div><br></div><div>Mentioning an update past the initial =
proposal; there are two forms:</div><div><br></div><div style=3D"background=
-color: rgb(250, 250, 250); border: 1px solid rgb(187, 187, 187); word-wrap=
: break-word; " class=3D"prettyprint"><code class=3D"prettyprint"><div clas=
s=3D"subprettyprint"><span style=3D"color: #008;" class=3D"styled-by-pretti=
fy">template</span><span style=3D"color: #660;" class=3D"styled-by-prettify=
">&lt;&gt;</span><span style=3D"color: #008;" class=3D"styled-by-prettify">=
class</span><span style=3D"color: #000;" class=3D"styled-by-prettify"> sequ=
ence </span><span style=3D"color: #660;" class=3D"styled-by-prettify">{</sp=
an><span style=3D"color: #008;" class=3D"styled-by-prettify">const</span><s=
pan style=3D"color: #000;" class=3D"styled-by-prettify"> T</span><span styl=
e=3D"color: #660;" class=3D"styled-by-prettify">*</span><span style=3D"colo=
r: #000;" class=3D"styled-by-prettify"> </span><span style=3D"color: #008;"=
 class=3D"styled-by-prettify">const</span><span style=3D"color: #000;" clas=
s=3D"styled-by-prettify"> element</span><span style=3D"color: #660;" class=
=3D"styled-by-prettify">;</span><span style=3D"color: #000;" class=3D"style=
d-by-prettify"> </span><span style=3D"color: #008;" class=3D"styled-by-pret=
tify">const</span><span style=3D"color: #000;" class=3D"styled-by-prettify"=
> size_t size</span><span style=3D"color: #660;" class=3D"styled-by-prettif=
y">;};</span><span style=3D"color: #000;" class=3D"styled-by-prettify"> </s=
pan><span style=3D"color: #800;" class=3D"styled-by-prettify">// for immuta=
ble elements</span><span style=3D"color: #000;" class=3D"styled-by-prettify=
"><br></span><span style=3D"color: #008;" class=3D"styled-by-prettify">temp=
late</span><span style=3D"color: #660;" class=3D"styled-by-prettify">&lt;&g=
t;</span><span style=3D"color: #008;" class=3D"styled-by-prettify">class</s=
pan><span style=3D"color: #000;" class=3D"styled-by-prettify"> mutable_sequ=
ence </span><span style=3D"color: #660;" class=3D"styled-by-prettify">{</sp=
an><span style=3D"color: #000;" class=3D"styled-by-prettify">T</span><span =
style=3D"color: #660;" class=3D"styled-by-prettify">*</span><span style=3D"=
color: #000;" class=3D"styled-by-prettify"> </span><span style=3D"color: #0=
08;" class=3D"styled-by-prettify">const</span><span style=3D"color: #000;" =
class=3D"styled-by-prettify"> element</span><span style=3D"color: #660;" cl=
ass=3D"styled-by-prettify">;</span><span style=3D"color: #000;" class=3D"st=
yled-by-prettify"> </span><span style=3D"color: #008;" class=3D"styled-by-p=
rettify">const</span><span style=3D"color: #000;" class=3D"styled-by-pretti=
fy"> size_t size</span><span style=3D"color: #660;" class=3D"styled-by-pret=
tify">;};</span><span style=3D"color: #000;" class=3D"styled-by-prettify"> =
</span><span style=3D"color: #800;" class=3D"styled-by-prettify">// for mut=
able elements</span><span style=3D"color: #000;" class=3D"styled-by-prettif=
y"><br></span></div></code></div><div><br><br></div><div>Thus:</div><div st=
yle=3D"background-color: rgb(250, 250, 250); border: 1px solid rgb(187, 187=
, 187); word-wrap: break-word; " class=3D"prettyprint"><code class=3D"prett=
yprint"><div class=3D"subprettyprint"><span style=3D"color: #008;" class=3D=
"styled-by-prettify">const</span><span style=3D"color: #000;" class=3D"styl=
ed-by-prettify"> array_ref</span><span style=3D"color: #080;" class=3D"styl=
ed-by-prettify">&lt;int&gt;</span><span style=3D"color: #000;" class=3D"sty=
led-by-prettify"><br>sequence</span><span style=3D"color: #080;" class=3D"s=
tyled-by-prettify">&lt;int&gt;</span><span style=3D"color: #000;" class=3D"=
styled-by-prettify"><br>sequence</span><span style=3D"color: #080;" class=
=3D"styled-by-prettify">&lt;int&gt;</span><span style=3D"color: #660;" clas=
s=3D"styled-by-prettify">&amp;</span><span style=3D"color: #000;" class=3D"=
styled-by-prettify"><br></span><span style=3D"color: #008;" class=3D"styled=
-by-prettify">const</span><span style=3D"color: #000;" class=3D"styled-by-p=
rettify"> sequence</span><span style=3D"color: #080;" class=3D"styled-by-pr=
ettify">&lt;int&gt;</span><span style=3D"color: #000;" class=3D"styled-by-p=
rettify"><br></span><span style=3D"color: #008;" class=3D"styled-by-prettif=
y">const</span><span style=3D"color: #000;" class=3D"styled-by-prettify"> s=
equence</span><span style=3D"color: #080;" class=3D"styled-by-prettify">&lt=
;int&gt;</span><span style=3D"color: #660;" class=3D"styled-by-prettify">&a=
mp;</span><span style=3D"color: #000;" class=3D"styled-by-prettify"><br></s=
pan><span style=3D"color: #008;" class=3D"styled-by-prettify">const</span><=
span style=3D"color: #000;" class=3D"styled-by-prettify"> mutable_sequence<=
/span><span style=3D"color: #080;" class=3D"styled-by-prettify">&lt;int&gt;=
</span><span style=3D"color: #000;" class=3D"styled-by-prettify"><br></span=
><span style=3D"color: #008;" class=3D"styled-by-prettify">const</span><spa=
n style=3D"color: #000;" class=3D"styled-by-prettify"> mutable_sequence</sp=
an><span style=3D"color: #080;" class=3D"styled-by-prettify">&lt;int&gt;</s=
pan><span style=3D"color: #660;" class=3D"styled-by-prettify">&amp;</span><=
span style=3D"color: #000;" class=3D"styled-by-prettify"><br></span></div><=
/code></div><div><br><br></div><div>All specify objects which have invarian=
t size and pointer. In all cases, mutable elements may not be provided by t=
he class although they may be externally modified.</div><div><br></div><div=
>Naturally, there will also be cases where the optimizer can prove a value =
of type array_ref&lt;int&gt; does not alter its size or pointer.</div><div>=
<br></div><div>&nbsp;(excuse the edit noise)</div>

<p></p>

-- <br />
&nbsp;<br />
--- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals&quot; group.<br />
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to std-proposals+unsubscribe@isocpp.org.<br />
To post to this group, send email to std-proposals@isocpp.org.<br />
Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/group/=
std-proposals/?hl=3Den">http://groups.google.com/a/isocpp.org/group/std-pro=
posals/?hl=3Den</a>.<br />
&nbsp;<br />
&nbsp;<br />

------=_Part_929_15563790.1370393536677--

.
