220 4865 <1a298dfc-9fb0-4124-9ad5-4b3afc3afa3f@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 16:13:04 -0700 (PDT)
Lines: 596
Approved: news@gmane.org
Message-ID: <1a298dfc-9fb0-4124-9ad5-4b3afc3afa3f@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>
 <d9ba9a97-bbd0-477a-b7ac-9db84da40458@isocpp.org>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: plane.gmane.org
Mime-Version: 1.0
Content-Type: multipart/alternative; 
	boundary="----=_Part_1036_11401103.1370387584888"
X-Trace: ger.gmane.org 1370387587 15816 80.91.229.3 (4 Jun 2013 23:13:07 GMT)
X-Complaints-To: usenet@ger.gmane.org
NNTP-Posting-Date: Tue, 4 Jun 2013 23:13:07 +0000 (UTC)
To: std-proposals@isocpp.org
Original-X-From: std-proposals+bncBDQ2R4E5RIKBBAXJXGGQKGQEZNNLZDQ@isocpp.org Wed Jun 05 01:13:08 2013
Return-path: <std-proposals+bncBDQ2R4E5RIKBBAXJXGGQKGQEZNNLZDQ@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-qa0-f72.google.com ([209.85.216.72])
	by plane.gmane.org with esmtp (Exim 4.69)
	(envelope-from <std-proposals+bncBDQ2R4E5RIKBBAXJXGGQKGQEZNNLZDQ@isocpp.org>)
	id 1Uk0Pb-0001Qq-QY
	for gclcip-std-proposals@m.gmane.org; Wed, 05 Jun 2013 01:13:08 +0200
Original-Received: by mail-qa0-f72.google.com with SMTP id bs12sf1471754qab.7
        for <gclcip-std-proposals@m.gmane.org>; Tue, 04 Jun 2013 16:13:07 -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=WHefMPeZuY6Ml/s4FnI1Dc6UpHrroxo0RMPduPQHu9E=;
        b=nUFNkg3d4hdxV0DdI64HxXiheiaVn//6ftsN1iYTvvinm2QvwkUISKyxyyppEh8ACx
         ucrmTFp77whQmhaPW064emIviQIU0GQ/vjtBiNcuiSePh7f/PpmO3p22tSU2YgcGpSsN
         LaN7Q5wrzkGkcYm7pxdRhYeQ7K6F4Y5HPW2r6OsddOuARAht+Ph7rpdtnEZ6lrG0ygCT
         KXy1/en9THWxxS0K71Rhl8tRnqm1hQO24vk315usv29FRiWM3bhXjp++lSh9+y5+roy/
         LEDoh6HPZ/v2ZI3Elgm5mJtYKOZg+eWQ031P0bCra2s44g3GaFinePCU6eCRHkKtvwH+
         cSMw==
X-Received: by 10.224.174.145 with SMTP id t17mr17506700qaz.4.1370387586906;
        Tue, 04 Jun 2013 16:13:06 -0700 (PDT)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.49.117.104 with SMTP id kd8ls605308qeb.93.gmail; Tue, 04 Jun
 2013 16:13:05 -0700 (PDT)
X-Received: by 10.49.24.37 with SMTP id r5mr2187618qef.10.1370387585237;
        Tue, 04 Jun 2013 16:13:05 -0700 (PDT)
In-Reply-To: <d9ba9a97-bbd0-477a-b7ac-9db84da40458@isocpp.org>
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:4865
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/4865>

------=_Part_1036_11401103.1370387584888
Content-Type: text/plain; charset=ISO-8859-1



On Tuesday, June 4, 2013 2:41:43 PM UTC-4, Nicol Bolas wrote:
>
> On Tuesday, June 4, 2013 7:27:59 AM UTC-7, carrieran...@yahoo.co.uk wrote:
>>
>> On Monday, June 3, 2013 6:39:35 PM UTC-4, Nicol Bolas wrote:
>>>
>>> On Monday, June 3, 2013 1:24:54 PM UTC-7, carrieran...@yahoo.co.ukwrote:
>>>
>>>> re Lightweight: The smallest array_ref could be the same size as a 
>>>> sequence. Because array_ref's members are not const, it could result in 
>>>> larger and slower code.
>>>>
>>>
>>> ... how? They'll just be a pair of pointers or a pointer+size either way.
>>>
>>
>> So you have checked my math. What exactly is your question?
>>
>
> Felipe covered this one, but I'll reiterate. You claimed that array_ref's 
> members not being `const` would make code "larger and slower". How? In what 
> cases could that possibly happen?
>
> Shrinking did not exist in my proposal because I never needed that 
>>>> functionality. I was content with the guarantees the type provided and its 
>>>> simplicity. The type did not attempt to be an iterator, range, or scanner 
>>>> as well. I've found slicing quite effective.
>>>>
>>>
>>> I don't really see how that's an argument, especially considering again 
>>> that Google and LLVM *do* need this functionality. They didn't write 
>>> those functions just because they could. Does your class get as much usage 
>>> as all internal Google and LLVM C++ projects? If not, then I would rather 
>>> defer to the guys who have the usage experience.
>>>
>>
>> Since explaining this to you, endorsement comes out as the heart of your 
>> objection?
>>
>
> No, the heart of my objections are these:
>
> 1: The committee already saw a proposal that was similar to what you 
> suggest. A proposal that was rejected (for reasons that I find dubious, but 
> nevermind that now).
>
> 2: Your proposal is not different enough from the rejected one to likely 
> gain any traction with the committee. Especially over the solution that 
> many committee members apparently prefer (ie: wait for ranges/traversal/etc 
> and hope that *they* solve the problem).
>
> 3: Your proposal, when compared to the rejected one, is a needless step 
> backwards. The standard must serve more needs than just your own. While the 
> fact that you haven't needed to modify these "sequences" is interesting, 
> the fact that *other* people clearly do have that need outweighs that. 
> And most notably, the apparently committee-preferred solution (ie: 
> iterator_range) is quite mutable, if it's based on the 
> boost::iterator_range<http://www.boost.org/doc/libs/1_53_0/libs/range/doc/html/range/reference/utilities/iterator_range.html>. 
> So that's LLVM, Google, *and* Boost, all of whom think mutability is 
> important.
>
> You need to realize that there is a call for library proposals and that 
>> this is the forum for such proposals: "The door is open for submissions 
>> of features to be added to the standard library, and we would love to see 
>> them not only from existing community libraries like Boost, Poco, and Qt, 
>> but from *you*.". <http://isocpp.org/std/submit-a-proposal> Proposals 
>> don't need your endorsement watchdogging. Let's stay squarely on topic.
>>
>
> This forum is for commentary on proposals and inquiry on proposals, so as 
> to either fix issues in proposals (like not being able to modify the 
> object) or to otherwise refine them and make them better before proposing 
> them. Not agreeing with commentary does not make that commentary invalid.
>
> I'm not stopping you from writing up a proposal and submitting it. But I'm 
> not going to pretend that I think it would be a worthwhile use of the 
> committee's time debating and voting on it either, compared to either 
> getting array_ref back or the apparently committee preferred solution.
>

0. I've just responded to Felipe.

1. I've not followed all the proposals. I didn't know of array_ref when I 
proposed. Its proposal also preceded the open call (perhaps it's a bit 
dusty at this point). I will have to look for the reason concerning its 
rejection.

2. Ok. Thanks for the heads up. I plan to float a more concrete iteration 
in a few days (more below).

3. You can easily refer to a slice of the sequence or request an iterator 
from it -- seems more logical to hoist the implementation out to a type 
dedicated to the given problem (e.g. iterator). Don't forget that sequences 
offer mutable elements while array_ref does not. IMO, mutable elements 
offer greater applicability than array_ref's shrinking and assignment. 
Because of this distinction, one could say that sequences more accurately 
resemble llvm's ArrayRef and MutableArrayRef than the proposed array_ref. I 
tried to explain how that step forward combined with the step "backwards" 
makes for what I consider very clean semantics in use, but here's how it 
unfolds:

=== Array Refs ===

void foo(array_ref<T> p); // foo can shrink either end of p or reassign p. 
of course, that change is local to the function.
void foo(array_ref<T>& p); // foo can shrink either end of p or reassign p, 
and the caller will see that change
void foo(const array_ref<T> p); // foo can read the elements and the size
void foo(const array_ref<T>& p); // foo can read the elements and the size



In no case can foo alter the array elements.

=== Sequences ===

void foo(sequence<T> p);
void foo(sequence<T>& p);
void foo(const sequence<T> p);
void foo(const sequence<T>& p);


In all cases, foo() can access the elements, but not mutate them.

void foo(mutable_sequence<T> p);
void foo(mutable_sequence<T>& p);


In both cases, foo() can read and mutate the elements.

void foo(const mutable_sequence<T> p);
void foo(const mutable_sequence<T>& p);


In both cases, foo() can access the elements, but not mutate them.

=== Practical comparison with redundance eliminated ===

=== Array Refs ===

void foo(array_ref<T> p); // foo can shrink either end of p or reassign p. 
of course, that change is local to the function.
void foo(array_ref<T>& p); // foo can shrink either end of p or reassign p, 
and the caller will see that change.
void foo(const array_ref<T> p); // foo can read the elements and the size.


In no case can foo alter the array elements.

=== Sequences ===

void foo(sequence<T> p); // foo() can access the elements, but not mutate 
them.
void foo(mutable_sequence<T> p); // foo() can access the elements and also 
mutate them.


For foo(const mutable_sequence<T>) and foo(const mutable_sequence<T>& p) 
one would just declare void foo(sequence<T> p) instead.

=== End Practical comparison ===

Anyways, I should just make a more concrete representation of this for you 
all before we spend more time on the shrink/assign issue. If there is 
interest at that stage, I think the next logical step would be for me to 
float a basic implementation you all can try out where features such as 
assignment can be enabled via the preprocessor. In essence, that would 
change members from:

template<>class sequence {T* const elements; const size_t size;};


to:
template<>class sequence {T* elements; size_t size;};

Thus adding the following to practical signatures:
void foo(sequence<T>& p); // foo() can access the elements, but not mutate 
them. p may be shrunk or reassigned.
void foo(mutable_sequence<T>& p); // foo() can access the elements and also 
mutate them. p may be shrunk or reassigned.

Adding sequences isn't for my personal benefit; I mentioned I already have 
an implementation. Sure, it would help in some cases outside of my codebase 
but I don't see how sequences serve me more than it would serve anybody in 
this group.

Glad we could bring this back on track.
 

-- 

--- 
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_1036_11401103.1370387584888
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

<br><br>On Tuesday, June 4, 2013 2:41:43 PM UTC-4, Nicol Bolas wrote:<block=
quote class=3D"gmail_quote" style=3D"margin: 0;margin-left: 0.8ex;border-le=
ft: 1px #ccc solid;padding-left: 1ex;">On Tuesday, June 4, 2013 7:27:59 AM =
UTC-7, <a>carrieran...@yahoo.co.uk</a> wrote:<blockquote class=3D"gmail_quo=
te" style=3D"margin:0;margin-left:0.8ex;border-left:1px #ccc solid;padding-=
left:1ex">On Monday, June 3, 2013 6:39:35 PM UTC-4, Nicol Bolas wrote:<bloc=
kquote class=3D"gmail_quote" style=3D"margin:0;margin-left:0.8ex;border-lef=
t:1px #ccc solid;padding-left:1ex">On Monday, June 3, 2013 1:24:54 PM UTC-7=
, <a>carrieran...@yahoo.co.uk</a> wrote:<br><blockquote class=3D"gmail_quot=
e" style=3D"margin:0;margin-left:0.8ex;border-left:1px #ccc solid;padding-l=
eft:1ex"><div>re Lightweight: The smallest array_ref could be the same size=
 as a sequence. Because array_ref's members are not const, it could result =
in larger and slower code.</div></blockquote><div><br>... how? They'll just=
 be a pair of pointers or a pointer+size either way.<br></div></blockquote>=
<div><br></div><div>So you have checked my math. What exactly is your quest=
ion?</div></blockquote><div><br>Felipe covered this one, but I'll reiterate=
.. You claimed that array_ref's members not being `const` would make code "l=
arger and slower". How? In what cases could that possibly happen?<br><br></=
div><blockquote class=3D"gmail_quote" style=3D"margin:0;margin-left:0.8ex;b=
order-left:1px #ccc solid;padding-left:1ex"><blockquote class=3D"gmail_quot=
e" style=3D"margin:0;margin-left:0.8ex;border-left:1px #ccc solid;padding-l=
eft:1ex"><blockquote class=3D"gmail_quote" style=3D"margin:0;margin-left:0.=
8ex;border-left:1px #ccc solid;padding-left:1ex"><div>Shrinking did not exi=
st in my proposal because I never needed that functionality. I was content =
with the guarantees the type provided and its simplicity. The type did not =
attempt to be an iterator, range, or scanner as well. I've found slicing qu=
ite effective.</div></blockquote><div><br>I don't really see how that's an =
argument, especially considering again that Google and LLVM <i>do</i> need =
this functionality. They didn't write those functions just because they cou=
ld. Does your class get as much usage as all internal Google and LLVM C++ p=
rojects? If not, then I would rather defer to the guys who have the usage e=
xperience.<br></div></blockquote><div><br></div><div>Since explaining this =
to you, endorsement comes out as the heart of your objection?</div></blockq=
uote><div><br>No, the heart of my objections are these:<br><br>1: The commi=
ttee already saw a proposal that was similar to what you suggest. A proposa=
l that was rejected (for reasons that I find dubious, but nevermind that no=
w).<br><br>2: Your proposal is not different enough from the rejected one t=
o likely gain any traction with the committee. Especially over the solution=
 that many committee members apparently prefer (ie: wait for ranges/travers=
al/etc and hope that <i>they</i> solve the problem).<br><br>3: Your proposa=
l, when compared to the rejected one, is a needless step backwards. The sta=
ndard must serve more needs than just your own. While the fact that you hav=
en't needed to modify these "sequences" is interesting, the fact that <i>ot=
her</i> people clearly do have that need outweighs that. And most notably, =
the apparently committee-preferred solution (ie: iterator_range) is quite m=
utable, if it's based on the <a href=3D"http://www.boost.org/doc/libs/1_53_=
0/libs/range/doc/html/range/reference/utilities/iterator_range.html" target=
=3D"_blank">boost::iterator_range</a>. So that's LLVM, Google, <i>and</i> B=
oost, all of whom think mutability is important.<br><br></div><blockquote c=
lass=3D"gmail_quote" style=3D"margin:0;margin-left:0.8ex;border-left:1px #c=
cc solid;padding-left:1ex"><div>You need to realize that there is a call fo=
r library proposals and that this is the forum for such proposals: <a href=
=3D"http://isocpp.org/std/submit-a-proposal" target=3D"_blank">"The door is=
 open for submissions of features to be added to the standard library, and =
we would love to see them not only from existing community libraries like B=
oost, Poco, and Qt, but from <i>you</i>.".</a>&nbsp;Proposals don't need yo=
ur endorsement watchdogging. Let's stay squarely on topic.</div></blockquot=
e><div><br>This forum is for commentary on proposals and inquiry on proposa=
ls, so as to either fix issues in proposals (like not being able to modify =
the object) or to otherwise refine them and make them better before proposi=
ng them. Not agreeing with commentary does not make that commentary invalid=
..<br><br>I'm not stopping you from writing up a proposal and submitting it.=
 But I'm not going to pretend that I think it would be a worthwhile use of =
the committee's time debating and voting on it either, compared to either g=
etting array_ref back or the apparently committee preferred solution.<br></=
div></blockquote><div><br></div><div>0. I've just responded to Felipe.</div=
><div><br></div><div>1. I've not followed all the proposals. I didn't know =
of array_ref when I proposed. Its proposal also preceded the open call (per=
haps it's a bit dusty at this point). I will have to look for the reason co=
ncerning its rejection.</div><div><br></div><div>2. Ok. Thanks for the head=
s up. I plan to float a more concrete iteration in a few days (more below).=
</div><div><br></div><div>3. You can easily refer to a slice of the sequenc=
e or request an iterator from it -- seems more logical to hoist the impleme=
ntation out to a type dedicated to the given problem (e.g. iterator). Don't=
 forget that sequences offer mutable elements while array_ref does not. IMO=
, mutable elements offer greater applicability than array_ref's shrinking a=
nd assignment. Because of this distinction, one could say that sequences mo=
re accurately resemble llvm's ArrayRef and MutableArrayRef than the propose=
d array_ref. I tried to explain how that step forward combined with the ste=
p "backwards" makes for what I consider very clean semantics in use, but he=
re's how it unfolds:</div><div><br></div><div>=3D=3D=3D Array Refs =3D=3D=
=3D</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"pr=
ettyprint"><code class=3D"prettyprint"><div class=3D"subprettyprint"><span =
style=3D"color: #008;" class=3D"styled-by-prettify">void</span><span style=
=3D"color: #000;" class=3D"styled-by-prettify"> foo</span><span style=3D"co=
lor: #660;" class=3D"styled-by-prettify">(</span><span style=3D"color: #000=
;" class=3D"styled-by-prettify">array_ref</span><span style=3D"color: #660;=
" class=3D"styled-by-prettify">&lt;</span><span style=3D"color: #000;" clas=
s=3D"styled-by-prettify">T</span><span style=3D"color: #660;" class=3D"styl=
ed-by-prettify">&gt;</span><span style=3D"color: #000;" class=3D"styled-by-=
prettify"> p</span><span style=3D"color: #660;" class=3D"styled-by-prettify=
">);</span><span style=3D"color: #000;" class=3D"styled-by-prettify"> </spa=
n><span style=3D"color: #800;" class=3D"styled-by-prettify">// foo can shri=
nk either end of p or reassign p. of course, that change is local to the fu=
nction.</span><span style=3D"color: #000;" class=3D"styled-by-prettify"><br=
></span><span style=3D"color: #008;" class=3D"styled-by-prettify">void</spa=
n><span style=3D"color: #000;" class=3D"styled-by-prettify"> foo</span><spa=
n style=3D"color: #660;" class=3D"styled-by-prettify">(</span><span style=
=3D"color: #000;" class=3D"styled-by-prettify">array_ref</span><span style=
=3D"color: #660;" class=3D"styled-by-prettify">&lt;</span><span style=3D"co=
lor: #000;" class=3D"styled-by-prettify">T</span><span style=3D"color: #660=
;" class=3D"styled-by-prettify">&gt;&amp;</span><span style=3D"color: #000;=
" class=3D"styled-by-prettify"> p</span><span style=3D"color: #660;" class=
=3D"styled-by-prettify">);</span><span style=3D"color: #000;" class=3D"styl=
ed-by-prettify"> </span><span style=3D"color: #800;" class=3D"styled-by-pre=
ttify">// foo can shrink either end of p or reassign p, and the caller will=
 see that change</span><span style=3D"color: #000;" class=3D"styled-by-pret=
tify"><br></span><span style=3D"color: #008;" class=3D"styled-by-prettify">=
void</span><span style=3D"color: #000;" class=3D"styled-by-prettify"> foo</=
span><span style=3D"color: #660;" class=3D"styled-by-prettify">(</span><spa=
n style=3D"color: #008;" class=3D"styled-by-prettify">const</span><span sty=
le=3D"color: #000;" class=3D"styled-by-prettify"> array_ref</span><span sty=
le=3D"color: #660;" class=3D"styled-by-prettify">&lt;</span><span style=3D"=
color: #000;" class=3D"styled-by-prettify">T</span><span style=3D"color: #6=
60;" class=3D"styled-by-prettify">&gt;</span><span style=3D"color: #000;" c=
lass=3D"styled-by-prettify"> p</span><span style=3D"color: #660;" class=3D"=
styled-by-prettify">);</span><span style=3D"color: #000;" class=3D"styled-b=
y-prettify"> </span><span style=3D"color: #800;" class=3D"styled-by-prettif=
y">// foo can read the elements and the size</span><span style=3D"color: #0=
00;" class=3D"styled-by-prettify"><br></span><span style=3D"color: #008;" c=
lass=3D"styled-by-prettify">void</span><span style=3D"color: #000;" class=
=3D"styled-by-prettify"> foo</span><span style=3D"color: #660;" 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"> array_ref</span><span style=3D"color: #660;" class=3D"styled-by-pretti=
fy">&lt;</span><span style=3D"color: #000;" class=3D"styled-by-prettify">T<=
/span><span style=3D"color: #660;" class=3D"styled-by-prettify">&gt;&amp;</=
span><span style=3D"color: #000;" class=3D"styled-by-prettify"> p</span><sp=
an 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=
: #800;" class=3D"styled-by-prettify">// foo can read the elements and the =
size</span><span style=3D"color: #000;" class=3D"styled-by-prettify"><br><b=
r></span></div></code></div><div><br><br></div><div>In no case can foo alte=
r the array elements.</div><div><br></div><div>=3D=3D=3D Sequences =3D=3D=
=3D</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"pr=
ettyprint"><code class=3D"prettyprint"><div class=3D"subprettyprint"><span =
style=3D"color: #008;" class=3D"styled-by-prettify">void</span><span style=
=3D"color: #000;" class=3D"styled-by-prettify"> foo</span><span style=3D"co=
lor: #660;" class=3D"styled-by-prettify">(</span><span style=3D"color: #000=
;" class=3D"styled-by-prettify">sequence</span><span style=3D"color: #660;"=
 class=3D"styled-by-prettify">&lt;</span><span style=3D"color: #000;" class=
=3D"styled-by-prettify">T</span><span style=3D"color: #660;" class=3D"style=
d-by-prettify">&gt;</span><span style=3D"color: #000;" class=3D"styled-by-p=
rettify"> p</span><span style=3D"color: #660;" class=3D"styled-by-prettify"=
>);</span><span style=3D"color: #000;" class=3D"styled-by-prettify"><br></s=
pan><span style=3D"color: #008;" class=3D"styled-by-prettify">void</span><s=
pan style=3D"color: #000;" class=3D"styled-by-prettify"> foo</span><span st=
yle=3D"color: #660;" class=3D"styled-by-prettify">(</span><span style=3D"co=
lor: #000;" class=3D"styled-by-prettify">sequence</span><span style=3D"colo=
r: #660;" class=3D"styled-by-prettify">&lt;</span><span style=3D"color: #00=
0;" class=3D"styled-by-prettify">T</span><span style=3D"color: #660;" class=
=3D"styled-by-prettify">&gt;&amp;</span><span style=3D"color: #000;" class=
=3D"styled-by-prettify"> p</span><span style=3D"color: #660;" class=3D"styl=
ed-by-prettify">);</span><span style=3D"color: #000;" class=3D"styled-by-pr=
ettify"><br></span><span style=3D"color: #008;" class=3D"styled-by-prettify=
">void</span><span style=3D"color: #000;" class=3D"styled-by-prettify"> foo=
</span><span style=3D"color: #660;" class=3D"styled-by-prettify">(</span><s=
pan style=3D"color: #008;" class=3D"styled-by-prettify">const</span><span s=
tyle=3D"color: #000;" class=3D"styled-by-prettify"> sequence</span><span st=
yle=3D"color: #660;" class=3D"styled-by-prettify">&lt;</span><span style=3D=
"color: #000;" class=3D"styled-by-prettify">T</span><span style=3D"color: #=
660;" class=3D"styled-by-prettify">&gt;</span><span style=3D"color: #000;" =
class=3D"styled-by-prettify"> p</span><span style=3D"color: #660;" class=3D=
"styled-by-prettify">);</span><span style=3D"color: #000;" class=3D"styled-=
by-prettify"><br></span><span style=3D"color: #008;" class=3D"styled-by-pre=
ttify">void</span><span style=3D"color: #000;" class=3D"styled-by-prettify"=
> foo</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"> sequence</span><sp=
an style=3D"color: #660;" class=3D"styled-by-prettify">&lt;</span><span sty=
le=3D"color: #000;" class=3D"styled-by-prettify">T</span><span style=3D"col=
or: #660;" class=3D"styled-by-prettify">&gt;&amp;</span><span style=3D"colo=
r: #000;" class=3D"styled-by-prettify"> p</span><span style=3D"color: #660;=
" class=3D"styled-by-prettify">);</span><span style=3D"color: #000;" class=
=3D"styled-by-prettify"><br></span></div></code></div><div><br><br></div><d=
iv>In all cases, foo() can access the elements, but not mutate them.</div><=
div><br></div><div style=3D"background-color: rgb(250, 250, 250); border: 1=
px solid rgb(187, 187, 187); word-wrap: break-word; " class=3D"prettyprint"=
><code class=3D"prettyprint"><div class=3D"subprettyprint"><span style=3D"c=
olor: #008;" class=3D"styled-by-prettify">void</span><span style=3D"color: =
#000;" class=3D"styled-by-prettify"> foo</span><span style=3D"color: #660;"=
 class=3D"styled-by-prettify">(</span><span style=3D"color: #000;" class=3D=
"styled-by-prettify">mutable_sequence</span><span style=3D"color: #660;" cl=
ass=3D"styled-by-prettify">&lt;</span><span style=3D"color: #000;" class=3D=
"styled-by-prettify">T</span><span style=3D"color: #660;" class=3D"styled-b=
y-prettify">&gt;</span><span style=3D"color: #000;" class=3D"styled-by-pret=
tify"> p</span><span style=3D"color: #660;" class=3D"styled-by-prettify">);=
</span><span style=3D"color: #000;" class=3D"styled-by-prettify"><br></span=
><span style=3D"color: #008;" class=3D"styled-by-prettify">void</span><span=
 style=3D"color: #000;" class=3D"styled-by-prettify"> foo</span><span style=
=3D"color: #660;" class=3D"styled-by-prettify">(</span><span style=3D"color=
: #000;" class=3D"styled-by-prettify">mutable_sequence</span><span style=3D=
"color: #660;" class=3D"styled-by-prettify">&lt;</span><span style=3D"color=
: #000;" class=3D"styled-by-prettify">T</span><span style=3D"color: #660;" =
class=3D"styled-by-prettify">&gt;&amp;</span><span style=3D"color: #000;" c=
lass=3D"styled-by-prettify"> p</span><span style=3D"color: #660;" class=3D"=
styled-by-prettify">);</span><span style=3D"color: #000;" class=3D"styled-b=
y-prettify"><br></span></div></code></div><div><br><br></div><div>In both c=
ases, foo() can read and mutate the elements.</div><div><br></div><div styl=
e=3D"background-color: rgb(250, 250, 250); border: 1px solid rgb(187, 187, =
187); word-wrap: break-word; " class=3D"prettyprint"><code class=3D"prettyp=
rint"><div class=3D"subprettyprint"><span style=3D"color: #008;" class=3D"s=
tyled-by-prettify">void</span><span style=3D"color: #000;" class=3D"styled-=
by-prettify"> foo</span><span style=3D"color: #660;" class=3D"styled-by-pre=
ttify">(</span><span style=3D"color: #008;" class=3D"styled-by-prettify">co=
nst</span><span style=3D"color: #000;" class=3D"styled-by-prettify"> mutabl=
e_sequence</span><span style=3D"color: #660;" class=3D"styled-by-prettify">=
&lt;</span><span style=3D"color: #000;" class=3D"styled-by-prettify">T</spa=
n><span style=3D"color: #660;" class=3D"styled-by-prettify">&gt;</span><spa=
n style=3D"color: #000;" class=3D"styled-by-prettify"> p</span><span style=
=3D"color: #660;" class=3D"styled-by-prettify">);</span><span style=3D"colo=
r: #000;" class=3D"styled-by-prettify"><br></span><span style=3D"color: #00=
8;" class=3D"styled-by-prettify">void</span><span style=3D"color: #000;" cl=
ass=3D"styled-by-prettify"> foo</span><span style=3D"color: #660;" class=3D=
"styled-by-prettify">(</span><span style=3D"color: #008;" class=3D"styled-b=
y-prettify">const</span><span style=3D"color: #000;" class=3D"styled-by-pre=
ttify"> mutable_sequence</span><span style=3D"color: #660;" class=3D"styled=
-by-prettify">&lt;</span><span style=3D"color: #000;" class=3D"styled-by-pr=
ettify">T</span><span style=3D"color: #660;" class=3D"styled-by-prettify">&=
gt;&amp;</span><span style=3D"color: #000;" class=3D"styled-by-prettify"> p=
</span><span style=3D"color: #660;" class=3D"styled-by-prettify">);</span><=
span style=3D"color: #000;" class=3D"styled-by-prettify"><br></span></div><=
/code></div><div><br><br></div><div>In both cases, foo() can access the ele=
ments, but not mutate them.</div><div><br></div><div>=3D=3D=3D Practical co=
mparison with redundance eliminated =3D=3D=3D</div><div><br></div><div>=3D=
=3D=3D Array Refs =3D=3D=3D</div><div><br></div><div style=3D"background-co=
lor: rgb(250, 250, 250); border: 1px solid rgb(187, 187, 187); word-wrap: b=
reak-word; " class=3D"prettyprint"><code class=3D"prettyprint"><div class=
=3D"subprettyprint"><span style=3D"color: #008;" class=3D"styled-by-prettif=
y">void</span><span style=3D"color: #000;" class=3D"styled-by-prettify"> fo=
o</span><span style=3D"color: #660;" class=3D"styled-by-prettify">(</span><=
span style=3D"color: #000;" class=3D"styled-by-prettify">array_ref</span><s=
pan style=3D"color: #660;" class=3D"styled-by-prettify">&lt;</span><span st=
yle=3D"color: #000;" class=3D"styled-by-prettify">T</span><span style=3D"co=
lor: #660;" class=3D"styled-by-prettify">&gt;</span><span style=3D"color: #=
000;" class=3D"styled-by-prettify"> p</span><span style=3D"color: #660;" cl=
ass=3D"styled-by-prettify">);</span><span style=3D"color: #000;" class=3D"s=
tyled-by-prettify"> </span><span style=3D"color: #800;" class=3D"styled-by-=
prettify">// foo can shrink either end of p or reassign p. of course, that =
change is local to the function.</span><span style=3D"color: #000;" class=
=3D"styled-by-prettify"><br></span><span style=3D"color: #008;" class=3D"st=
yled-by-prettify">void</span><span style=3D"color: #000;" class=3D"styled-b=
y-prettify"> foo</span><span style=3D"color: #660;" class=3D"styled-by-pret=
tify">(</span><span style=3D"color: #000;" class=3D"styled-by-prettify">arr=
ay_ref</span><span style=3D"color: #660;" class=3D"styled-by-prettify">&lt;=
</span><span style=3D"color: #000;" class=3D"styled-by-prettify">T</span><s=
pan style=3D"color: #660;" class=3D"styled-by-prettify">&gt;&amp;</span><sp=
an style=3D"color: #000;" class=3D"styled-by-prettify"> p</span><span style=
=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: #800;"=
 class=3D"styled-by-prettify">// foo can shrink either end of p or reassign=
 p, and the caller will see that change.</span><span style=3D"color: #000;"=
 class=3D"styled-by-prettify"><br></span><span style=3D"color: #008;" class=
=3D"styled-by-prettify">void</span><span style=3D"color: #000;" class=3D"st=
yled-by-prettify"> foo</span><span style=3D"color: #660;" class=3D"styled-b=
y-prettify">(</span><span style=3D"color: #008;" class=3D"styled-by-prettif=
y">const</span><span style=3D"color: #000;" class=3D"styled-by-prettify"> a=
rray_ref</span><span style=3D"color: #660;" class=3D"styled-by-prettify">&l=
t;</span><span style=3D"color: #000;" class=3D"styled-by-prettify">T</span>=
<span style=3D"color: #660;" class=3D"styled-by-prettify">&gt;</span><span =
style=3D"color: #000;" class=3D"styled-by-prettify"> p</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: #800;" cl=
ass=3D"styled-by-prettify">// foo can read the elements and the size.</span=
><span style=3D"color: #000;" class=3D"styled-by-prettify"><br></span></div=
></code></div><div><br><br></div><div>In no case can foo alter the array el=
ements.</div><div><br></div><div>=3D=3D=3D Sequences =3D=3D=3D</div><div><b=
r></div><div style=3D"background-color: rgb(250, 250, 250); border: 1px sol=
id rgb(187, 187, 187); word-wrap: break-word; " class=3D"prettyprint"><code=
 class=3D"prettyprint"><div class=3D"subprettyprint"><span style=3D"color: =
#008;" class=3D"styled-by-prettify">void</span><span style=3D"color: #000;"=
 class=3D"styled-by-prettify"> foo</span><span style=3D"color: #660;" class=
=3D"styled-by-prettify">(</span><span style=3D"color: #000;" class=3D"style=
d-by-prettify">sequence</span><span style=3D"color: #660;" class=3D"styled-=
by-prettify">&lt;</span><span style=3D"color: #000;" class=3D"styled-by-pre=
ttify">T</span><span style=3D"color: #660;" class=3D"styled-by-prettify">&g=
t;</span><span style=3D"color: #000;" class=3D"styled-by-prettify"> p</span=
><span style=3D"color: #660;" class=3D"styled-by-prettify">);</span><span s=
tyle=3D"color: #000;" class=3D"styled-by-prettify"> </span><span style=3D"c=
olor: #800;" class=3D"styled-by-prettify">// foo() can access the elements,=
 but not mutate them.</span><span style=3D"color: #000;" class=3D"styled-by=
-prettify"><br></span><span style=3D"color: #008;" class=3D"styled-by-prett=
ify">void</span><span style=3D"color: #000;" class=3D"styled-by-prettify"> =
foo</span><span style=3D"color: #660;" class=3D"styled-by-prettify">(</span=
><span style=3D"color: #000;" class=3D"styled-by-prettify">mutable_sequence=
</span><span style=3D"color: #660;" class=3D"styled-by-prettify">&lt;</span=
><span style=3D"color: #000;" class=3D"styled-by-prettify">T</span><span st=
yle=3D"color: #660;" class=3D"styled-by-prettify">&gt;</span><span style=3D=
"color: #000;" class=3D"styled-by-prettify"> p</span><span style=3D"color: =
#660;" class=3D"styled-by-prettify">);</span><span style=3D"color: #000;" c=
lass=3D"styled-by-prettify"> </span><span style=3D"color: #800;" class=3D"s=
tyled-by-prettify">// foo() can access the elements and also mutate them.</=
span><span style=3D"color: #000;" class=3D"styled-by-prettify"><br></span><=
/div></code></div><div><br><br></div><div>For foo(const mutable_sequence&lt=
;T&gt;) and foo(const mutable_sequence&lt;T&gt;&amp; p) one would just decl=
are void foo(sequence&lt;T&gt; p) instead.</div><div><br></div><div>=3D=3D=
=3D End Practical comparison =3D=3D=3D</div><div><br></div><div>Anyways, I =
should just make a more concrete representation of this for you all before =
we spend more time on the shrink/assign issue. If there is interest at that=
 stage, I think the next logical step would be for me to float a basic impl=
ementation you all can try out where features such as assignment can be ena=
bled via the preprocessor. In essence, that would change members from:</div=
><div><br></div><div><div style=3D"background-color: rgb(250, 250, 250); bo=
rder: 1px solid rgb(187, 187, 187); word-wrap: break-word; " class=3D"prett=
yprint"><code class=3D"prettyprint"><div class=3D"subprettyprint"><span sty=
le=3D"color: #008;" class=3D"styled-by-prettify">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"c=
olor: #000;" class=3D"styled-by-prettify"> sequence </span><span style=3D"c=
olor: #660;" class=3D"styled-by-prettify">{</span><span style=3D"color: #00=
0;" 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"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"=
> elements</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: #008;" class=3D"styled-by-prettify">const</span><span =
style=3D"color: #000;" class=3D"styled-by-prettify"> size_t size</span><spa=
n style=3D"color: #660;" class=3D"styled-by-prettify">;};</span></div></cod=
e></div><br></div><div><br></div><div>to:</div><div><div style=3D"backgroun=
d-color: rgb(250, 250, 250); border: 1px solid rgb(187, 187, 187); word-wra=
p: break-word; " class=3D"prettyprint"><code class=3D"prettyprint"><div cla=
ss=3D"subprettyprint"><span style=3D"color: #008;" class=3D"styled-by-prett=
ify">template</span><span style=3D"color: #660;" class=3D"styled-by-prettif=
y">&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"> seq=
uence </span><span style=3D"color: #660;" class=3D"styled-by-prettify">{</s=
pan><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"> elements</span><span style=3D"=
color: #660;" class=3D"styled-by-prettify">;</span><span style=3D"color: #0=
00;" class=3D"styled-by-prettify"> size_t size</span><span style=3D"color: =
#660;" class=3D"styled-by-prettify">;};</span></div></code></div><br></div>=
<div>Thus adding the following to practical signatures:</div><div><div clas=
s=3D"prettyprint" style=3D"border: 1px solid rgb(187, 187, 187); background=
-color: rgb(250, 250, 250); word-wrap: break-word; "><code class=3D"prettyp=
rint"><div class=3D"subprettyprint"><span style=3D"color: #008;" class=3D"s=
tyled-by-prettify">void</span><span style=3D"color: #000;" class=3D"styled-=
by-prettify"> foo</span><span style=3D"color: #660;" class=3D"styled-by-pre=
ttify">(</span><span style=3D"color: #000;" class=3D"styled-by-prettify">se=
quence</span><span style=3D"color: #660;" class=3D"styled-by-prettify">&lt;=
</span><span style=3D"color: #000;" class=3D"styled-by-prettify">T</span><s=
pan style=3D"color: #660;" class=3D"styled-by-prettify">&gt;&amp;</span><sp=
an style=3D"color: #000;" class=3D"styled-by-prettify"> p</span><span style=
=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: #800;"=
 class=3D"styled-by-prettify">// foo() can access the elements, but not mut=
ate them. p may be shrunk or reassigned.</span><span style=3D"color: #000;"=
 class=3D"styled-by-prettify"><br></span><span style=3D"color: #008;" class=
=3D"styled-by-prettify">void</span><span style=3D"color: #000;" class=3D"st=
yled-by-prettify"> foo</span><span style=3D"color: #660;" class=3D"styled-b=
y-prettify">(</span><span style=3D"color: #000;" class=3D"styled-by-prettif=
y">mutable_sequence</span><span style=3D"color: #660;" class=3D"styled-by-p=
rettify">&lt;</span><span style=3D"color: #000;" class=3D"styled-by-prettif=
y">T</span><span style=3D"color: #660;" class=3D"styled-by-prettify">&gt;&a=
mp;</span><span style=3D"color: #000;" class=3D"styled-by-prettify"> p</spa=
n><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: #800;" class=3D"styled-by-prettify">// foo() can access the elements=
 and also mutate them. </span><span style=3D"color: rgb(136, 0, 0); "><span=
 style=3D"color: #800;" class=3D"styled-by-prettify">p may be shrunk or rea=
ssigned.</span></span></div></code></div></div><div><br></div><div>Adding s=
equences isn't for my personal benefit; I mentioned I already have an imple=
mentation. Sure, it would help in some cases outside of my codebase but I d=
on't see how sequences serve me more than it would serve anybody in this gr=
oup.</div><div><br></div><div>Glad we could bring this back on track.</div>=
<div>&nbsp;</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_1036_11401103.1370387584888--

.
