220 7456 <03ecdc90-1973-4e34-82c9-ab0043241a2b@isocpp.org> article
Path: news.gmane.org!not-for-mail
From: Vlad from Moscow <vlad.moscow@mail.ru>
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: Re: Re: To add the method append for all sequential
 containers that have method push_back
Date: Wed, 23 Oct 2013 16:32:45 -0700 (PDT)
Lines: 214
Approved: news@gmane.org
Message-ID: <03ecdc90-1973-4e34-82c9-ab0043241a2b@isocpp.org>
References: <4167b82e-a3cc-44ce-9825-b52514bc1531@isocpp.org>
 <357325b0-cec5-4d22-ad56-9bb66f76b458@isocpp.org> <c98342aa-14d6-4fc6-8499-234c5e44e894@isocpp.org>
 <983ff074-5d8c-488a-b06c-49d53d5b7a5b@isocpp.org> <f47679d2-be05-4fdf-aea6-c617eb291aad@isocpp.org>
 <369298d9-3f8b-405a-8bfe-ae209372a26f@isocpp.org> <CAPBZbvzVuUKHsNSWz+KQPBzB1KJh0KgaY_cv6XuCwuhbZRhgHw@mail.gmail.com>
 <f844b34d-f64b-430d-9328-e44246a89238@isocpp.org> <f651b25b-213e-4c22-bd6e-17c96fde46a7@isocpp.org>
 <e826236a-84aa-4623-9510-014881b55004@isocpp.org> <5266DEEC.7090805@gmail.com>
 <eec4b9ca-711c-4b64-bac5-3c08bd3361a8@isocpp.org> <7c9a2637-65d8-4d54-bd3c-b46c0c22b34f@isocpp.org>
 <70a718dd-eca7-4845-8e9c-0313581ed453@isocpp.org> <6b9f62b2-21b1-4c62-a815-217d77a59a23@isocpp.org>
 <df68e700-1cb4-4af5-ba94-e4b589f33e0e@isocpp.org> <0e98fae6-2dc5-4e50-8659-5334012c4dd4@isocpp.org>
 <0d945506-2a09-4645-a68e-ada2b9898aa9@isocpp.org> <69dd52d3-c35e-4391-b998-d1a35c4599d6@isocpp.org>
 <e853f305-0999-437a-840c-3d829a24566d@isocpp.org> <CAGg_6+OvEyyLFZcGqo2xc0aDu4MeYiCmWMymW1YVNPJqJ1+S7A@mail.gmail.com>
 <CAFk2RUYQ1LkfCO5yXWPeStcadYuz7AO4V5bH=mfQMFNm45GM0Q@mail.gmail.com>
 <CAGsORuAyVwKGwdGMyAc3rg1KbOA3AXuYWwgubkXgt-oQRH9AiQ@mail.gmail.com>
 <fcf8d15e-af56-4351-bc4b-2e5984399240@isocpp.org> <CAGg_6+Ph8FRc+939QVuJbzYtbo-ef3zGqPsPFjXCY9AUDLPAFQ@mail.gmail.com>
 <CAGsORuAcTDjMcXVoAQ+MEUZ6DL0PEDW32RWDQSf4EyxS+Ln=tw@mail.gmail.com>
 <CAGsORuC0hbic60tY3sVng8K+-qMmekp83kq4Jed36O2+BQ5=UQ@mail.gmail.com> <0001b7d6-42ab-4f47-8104-1c5e93ecfbc4@isocpp.org>
 <CAPBZbvx-rmW3HcG+3WQrNbQ1gzr8UDj=2Xx+gRNOyhj5au61Xg@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_599_19636350.1382571165083"
X-Trace: ger.gmane.org 1382571161 28455 80.91.229.3 (23 Oct 2013 23:32:41 GMT)
X-Complaints-To: usenet@ger.gmane.org
NNTP-Posting-Date: Wed, 23 Oct 2013 23:32:41 +0000 (UTC)
To: std-proposals@isocpp.org
Original-X-From: std-proposals+bncBCXLLRHD7IDRBHNZUGJQKGQEXBBFIKA@isocpp.org Thu Oct 24 01:32:47 2013
Return-path: <std-proposals+bncBCXLLRHD7IDRBHNZUGJQKGQEXBBFIKA@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-qc0-f199.google.com ([209.85.216.199])
	by plane.gmane.org with esmtp (Exim 4.69)
	(envelope-from <std-proposals+bncBCXLLRHD7IDRBHNZUGJQKGQEXBBFIKA@isocpp.org>)
	id 1VZ7uw-0005F0-U5
	for gclcip-std-proposals@m.gmane.org; Thu, 24 Oct 2013 01:32:47 +0200
Original-Received: by mail-qc0-f199.google.com with SMTP id q4sf3349230qcx.2
        for <gclcip-std-proposals@m.gmane.org>; Wed, 23 Oct 2013 16:32:46 -0700 (PDT)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20130820;
        h=date:from:to:message-id:in-reply-to:references:subject:mime-version
         :x-original-sender:reply-to:precedence:mailing-list:list-id
         :list-post:list-help:list-archive:list-subscribe:list-unsubscribe
         :content-type;
        bh=/w7BqPKoCjixB7msRTndk04YWvq+duFdc69gd40e1II=;
        b=BhRFNbpl9nfKgJyglOh7rYvA1wIo536WAyCEHi1083nvPI4jGSYI/fi9AYXhQnhHEd
         6k/rHbVa/5qAonWyhG6foXQnHGCEPIMharWgyvy9fXClJnaNWv2XGP8Dneq3V7GPJS3s
         FURq8HCcg9kJ99xxZB2uVrFGddWsN8mUFnMZ28HSDfx+A8LI4byvhR9glAzgOZgEY/te
         NU4aU55Xm+Pz1FtMiw9/7CG827TePm4sM41go/P7oXGKeYJZLLhSyZKlELgfDCjfvxai
         xP4KK5G/dw+/N7YK7jbSZaiZHI6+oTbJ37yn91Z0yAxYebGA0tPZRZf0vMQhxYKRE6AT
         BqAw==
X-Received: by 10.224.24.65 with SMTP id u1mr378299qab.6.1382571166088;
        Wed, 23 Oct 2013 16:32:46 -0700 (PDT)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.49.49.42 with SMTP id r10ls678209qen.86.gmail; Wed, 23 Oct
 2013 16:32:45 -0700 (PDT)
X-Received: by 10.49.5.167 with SMTP id t7mr134277qet.7.1382571165502;
        Wed, 23 Oct 2013 16:32:45 -0700 (PDT)
In-Reply-To: <CAPBZbvx-rmW3HcG+3WQrNbQ1gzr8UDj=2Xx+gRNOyhj5au61Xg@mail.gmail.com>
X-Original-Sender: vlad.moscow@mail.ru
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>, <mailto:std-proposals@isocpp.org>
List-Help: <http://support.google.com/a/isocpp.org/bin/topic.py?topic=25838>, <mailto:std-proposals+help@isocpp.org>
List-Archive: <http://groups.google.com/a/isocpp.org/group/std-proposals/>
List-Subscribe: <http://groups.google.com/a/isocpp.org/group/std-proposals/subscribe>,
 <mailto:std-proposals+subscribe@isocpp.org>
List-Unsubscribe: <http://groups.google.com/a/isocpp.org/group/std-proposals/subscribe>,
 <mailto:googlegroups-manage+399137483710+unsubscribe@googlegroups.com>
Xref: news.gmane.org gmane.comp.lang.c++.isocpp.proposals:7456
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/7456>

------=_Part_599_19636350.1382571165083
Content-Type: text/plain; charset=KOI8-R
Content-Transfer-Encoding: quoted-printable

Billy, I do not think that append flows out of operator +=3D. It looks like=
=20
that operator +=3D flows out of append.:)
=20
To demonstrate that append looks much better than insert I will show the=20
following assignment.
 Let;s assume that there is a vector v1 and you need to copy  its elements=
=20
in another vector v2 excluding some range that specified by a pair=20
of iterators. For example one iterator points the first negative value of=
=20
the vector and the second iterator points the last negative value of the=20
vector. The simplest way to do the assignment is to write
=20
std::vector<int> v2( v1.begin(), range.first );
v2.append( std::next( range.second ), v1.end() );
=20
That is at first the part of the original vector before the first iterator=
=20
was copied and then the tail of the original vector  was appended.. The=20
code looks very logically and clearly due to using of append.
=20
=20
=20

=DE=C5=D4=D7=C5=D2=C7, 24 =CF=CB=D4=D1=C2=D2=D1 2013 =C7., 3:07:04 UTC+4 =
=D0=CF=CC=D8=DA=CF=D7=C1=D4=C5=CC=D8 Billy O'Neal=20
=CE=C1=D0=C9=D3=C1=CC:

> Again, append makes sense for basic_string because it corresponds to=20
> basic_string's operator+=3D. That operation doesn't necessarily make sens=
e=20
> for all containers.
>
> Billy O'Neal
> https://github.com/BillyONeal/ <https://bitbucket.org/BillyONeal/>
> http://stackoverflow.com/users/82320/billy-oneal
> Malware Response Instructor - BleepingComputer.com
>
>
> On Wed, Oct 23, 2013 at 4:05 PM, Vlad from Moscow <vlad....@mail.ru<javas=
cript:>
> > wrote:
>
>> In fact there is nothing new with the method append because it already=
=20
>> exists for std::basic_string. If somebody has some doubts then I advise =
to=20
>> try do not use append with std::basic string and substitute it everywher=
e=20
>> in code for insert. I am sure that through a month of such coding he wil=
l=20
>> quickly understand that method append is necessary.
>> =20
>> Introducing method append just makes the common interface of sequential=
=20
>> containers more consistent.
>>
>> =DE=C5=D4=D7=C5=D2=C7, 24 =CF=CB=D4=D1=C2=D2=D1 2013 =C7., 2:52:13 UTC+4=
 =D0=CF=CC=D8=DA=CF=D7=C1=D4=C5=CC=D8 Zhihao Yuan=20
>> =CE=C1=D0=C9=D3=C1=CC:
>>
>>> On Oct 23, 2013 6:31 PM, "Zhihao Yuan" <z...@miator.net> wrote:
>>> > I think we'd better not to regard this as merely a syntax sugar.  I=
=20
>>> looked at libc++ code and I found that since the position is known to b=
e=20
>>> end(), append() can be implemented in a much simpler way compared with=
=20
>>> insert().  Not sure how beneficial it is though, but so far it looks no=
t=20
>>> too useless.
>>>
>>> PS: If you agree with this rationale, I would suggest to add prepend()=
=20
>>> method to deque, list, and forward_list as well.
>>>
>>  --=20
>> =20
>> ---=20
>> You received this message because you are subscribed to the Google Group=
s=20
>> "ISO C++ Standard - Future Proposals" group.
>> To unsubscribe from this group and stop receiving emails from it, send a=
n=20
>> email to std-proposal...@isocpp.org <javascript:>.
>> To post to this group, send email to std-pr...@isocpp.org <javascript:>.
>> Visit this group at=20
>> http://groups.google.com/a/isocpp.org/group/std-proposals/.
>>
>
>

--=20

---=20
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 e=
mail 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-proposa=
ls/.

------=_Part_599_19636350.1382571165083
Content-Type: text/html; charset=KOI8-R
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div>Billy, I do not think that append flows out of operat=
or +=3D. It looks like that operator +=3D flows out of append.:)</div><div>=
&nbsp;</div><div>To demonstrate that append looks much better than insert I=
 will show the following assignment.</div><div>&nbsp;Let;s assume that ther=
e is a vector v1 and you need to copy&nbsp; its elements in another vector =
v2 excluding some range that specified by a&nbsp;pair of&nbsp;iterators. Fo=
r example one iterator points&nbsp;the first negative value of the vector a=
nd the&nbsp;second iterator points the last negative value of the vector. T=
he simplest way to do the assignment is to write</div><div>&nbsp;</div><div=
>std::vector&lt;int&gt; v2( v1.begin(),&nbsp;range.first );</div><div>v2.ap=
pend( std::next(&nbsp;range.second ), v1.end()&nbsp;);</div><div>&nbsp;</di=
v><div>That is at first the part of the original vector before the first it=
erator was copied and then&nbsp;the tail of the original vector &nbsp;was a=
ppended.. The code looks very logically and clearly due to using of append.=
</div><div>&nbsp;</div><div>&nbsp;</div><div>&nbsp;</div><div><br>=DE=C5=D4=
=D7=C5=D2=C7, 24 =CF=CB=D4=D1=C2=D2=D1 2013&nbsp;=C7., 3:07:04 UTC+4 =D0=CF=
=CC=D8=DA=CF=D7=C1=D4=C5=CC=D8 Billy O'Neal =CE=C1=D0=C9=D3=C1=CC:</div><bl=
ockquote class=3D"gmail_quote" style=3D"margin: 0px 0px 0px 0.8ex; padding-=
left: 1ex; border-left-color: rgb(204, 204, 204); border-left-width: 1px; b=
order-left-style: solid;"><div dir=3D"ltr">Again, append makes sense for ba=
sic_string because it corresponds to basic_string's operator+=3D. That oper=
ation doesn't necessarily make sense for all containers.</div><div><br clea=
r=3D"all">

<div><div dir=3D"ltr"><div>Billy O'Neal</div><div><a href=3D"https://bitbuc=
ket.org/BillyONeal/" target=3D"_blank">https://github.com/BillyONeal/</a></=
div><div><a href=3D"http://stackoverflow.com/users/82320/billy-oneal" targe=
t=3D"_blank">http://stackoverflow.com/<wbr>users/82320/billy-oneal</a></div=
>

<div>Malware Response Instructor - BleepingComputer.com</div></div></div>
<br><br><div class=3D"gmail_quote">On Wed, Oct 23, 2013 at 4:05 PM, Vlad fr=
om Moscow <span dir=3D"ltr">&lt;<a href=3D"javascript:" target=3D"_blank" g=
df-obfuscated-mailto=3D"9PGLlkUS58YJ">vlad....@mail.ru</a>&gt;</span> wrote=
:<br><blockquote class=3D"gmail_quote" style=3D"margin: 0px 0px 0px 0.8ex; =
padding-left: 1ex; border-left-color: rgb(204, 204, 204); border-left-width=
: 1px; border-left-style: solid;">

<div dir=3D"ltr"><div>In fact there is nothing new with the method append b=
ecause it already exists for std::basic_string.&nbsp;If somebody has some d=
oubts then I advise to try do not use append with std::basic string and sub=
stitute it everywhere in code for insert. I am sure that through a month of=
 such coding&nbsp;he will quickly understand that method append is necessar=
y.</div>

<div>&nbsp;</div><div>Introducing method append&nbsp;just makes&nbsp;the co=
mmon interface of sequential containers more consistent.</div><div><br>=DE=
=C5=D4=D7=C5=D2=C7, 24 =CF=CB=D4=D1=C2=D2=D1 2013&nbsp;=C7., 2:52:13 UTC+4 =
=D0=CF=CC=D8=DA=CF=D7=C1=D4=C5=CC=D8 Zhihao Yuan =CE=C1=D0=C9=D3=C1=CC:</di=
v><blockquote class=3D"gmail_quote" style=3D"margin: 0px 0px 0px 0.8ex; pad=
ding-left: 1ex; border-left-color: rgb(204, 204, 204); border-left-width: 1=
px; border-left-style: solid;">

<p>On Oct 23, 2013 6:31 PM, "Zhihao Yuan" &lt;<a>z...@miator.net</a>&gt; wr=
ote:<br>
&gt; I think we'd better not to regard this as merely a syntax sugar.&nbsp;=
 I looked at libc++ code and I found that since the position is known to be=
 end(), append() can be implemented in a much simpler way compared with ins=
ert().&nbsp; Not sure how beneficial it is though, but so far it looks not =
too useless.</p>



<p>PS: If you agree with this rationale, I would suggest to add prepend() m=
ethod to deque, list, and forward_list as well.</p><span><font color=3D"#88=
8888">
</font></span></blockquote></div><span><font color=3D"#888888">

<p></p>

-- <br>
&nbsp;<br>
--- <br>
You received this message because you are subscribed to the Google Groups "=
ISO C++ Standard - Future Proposals" group.<br>
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to <a href=3D"javascript:" target=3D"_blank" gdf-obfuscated-mailto=3D"=
9PGLlkUS58YJ">std-proposal...@<wbr>isocpp.org</a>.<br>
To post to this group, send email to <a href=3D"javascript:" target=3D"_bla=
nk" gdf-obfuscated-mailto=3D"9PGLlkUS58YJ">std-pr...@isocpp.org</a>.<br>
Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/group/=
std-proposals/" target=3D"_blank">http://groups.google.com/a/<wbr>isocpp.or=
g/group/std-<wbr>proposals/</a>.<br>
</font></span></blockquote></div><br></div>
</blockquote></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/">http://groups.google.com/a/isocpp.org/group/std-proposals/<=
/a>.<br />

------=_Part_599_19636350.1382571165083--

.
