220 7433 <CAPBZbvzO=8BavZwsnLcrzR53g7numKJ0K0oEAq_otP_RnhcBQA@mail.gmail.com> article
Path: news.gmane.org!not-for-mail
From: "Billy O'Neal" <billy.oneal@gmail.com>
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: Tue, 22 Oct 2013 15:56:04 -0700
Lines: 643
Approved: news@gmane.org
Message-ID: <CAPBZbvzO=8BavZwsnLcrzR53g7numKJ0K0oEAq_otP_RnhcBQA@mail.gmail.com>
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> <CAPBZbvy38LGtSaKYD7498K3xjpZdywMSiWaWkeL3_bEq_Y76Jw@mail.gmail.com>
 <f050366b-24a2-48bc-92f3-f6988c785fca@isocpp.org> <CAPBZbvxu0OH_aGMK7OqWgcu0ThJS31gP_r4ofCOhxUhFHQZrEQ@mail.gmail.com>
 <4ceba2fe-c45d-4eba-ba2e-59f1a0892393@isocpp.org>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: plane.gmane.org
Mime-Version: 1.0
Content-Type: multipart/alternative; boundary=001a1133073a8f07f404e95c5023
X-Trace: ger.gmane.org 1382482600 6621 80.91.229.3 (22 Oct 2013 22:56:40 GMT)
X-Complaints-To: usenet@ger.gmane.org
NNTP-Posting-Date: Tue, 22 Oct 2013 22:56:40 +0000 (UTC)
To: std-proposals <std-proposals@isocpp.org>
Original-X-From: std-proposals+bncBDKLBLVE6ADBBLMFTSJQKGQECLOF4FQ@isocpp.org Wed Oct 23 00:56:46 2013
Return-path: <std-proposals+bncBDKLBLVE6ADBBLMFTSJQKGQECLOF4FQ@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-qc0-f197.google.com ([209.85.216.197])
	by plane.gmane.org with esmtp (Exim 4.69)
	(envelope-from <std-proposals+bncBDKLBLVE6ADBBLMFTSJQKGQECLOF4FQ@isocpp.org>)
	id 1VYksY-0004Ty-9m
	for gclcip-std-proposals@m.gmane.org; Wed, 23 Oct 2013 00:56:46 +0200
Original-Received: by mail-qc0-f197.google.com with SMTP id x19sf33974qcw.0
        for <gclcip-std-proposals@m.gmane.org>; Tue, 22 Oct 2013 15:56:45 -0700 (PDT)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20130820;
        h=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:list-post:list-help:list-archive
         :list-subscribe:list-unsubscribe:content-type;
        bh=sieI+T3rm0JvC47uw6fqyj224PxbSUOa51oOq5p3xRE=;
        b=ilitpK5uTRgTwfYuqhiLFiDt4FHNUjuYHQt3UWVQb4velh7gN5Q0qjwLuCEEq2CXMD
         sftv9EtkOTL5bl1ZdCbKN6cune/v/5rbRnXpmsJBEyInIshnnCmIOcR3gORO/nkjmqG9
         jqQaJ1H7oa+fmEg65bb6xTnfrZobLq6Ryccx856P2R6uJWg5IVZohwN9Tk8hANWo/uZW
         YljPSlIm6ZrEGV4nAX1L1H18D/LDw6n+zz1pp4+kMH/3RrSjcI7HwsOFg5wCwGPMN5n7
         RkoSBrUReys4yGPr8ZO+22KZd7cTVvOgiV9IXGpW/JJ9EBFxgIGK+7mQ4bLen9wHFQva
         iyQg==
X-Received: by 10.236.20.114 with SMTP id o78mr22440592yho.8.1382482605505;
        Tue, 22 Oct 2013 15:56:45 -0700 (PDT)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.182.52.136 with SMTP id t8ls187116obo.60.gmail; Tue, 22 Oct
 2013 15:56:44 -0700 (PDT)
X-Received: by 10.60.52.1 with SMTP id p1mr3968100oeo.41.1382482604931;
        Tue, 22 Oct 2013 15:56:44 -0700 (PDT)
Original-Received: from mail-oa0-x22a.google.com (mail-oa0-x22a.google.com [2607:f8b0:4003:c02::22a])
        by mx.google.com with ESMTPS id q1si2861207oev.75.2013.10.22.15.56.44
        for <std-proposals@isocpp.org>
        (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128);
        Tue, 22 Oct 2013 15:56:44 -0700 (PDT)
Received-SPF: pass (google.com: domain of billy.oneal@gmail.com designates 2607:f8b0:4003:c02::22a as permitted sender) client-ip=2607:f8b0:4003:c02::22a;
Original-Received: by mail-oa0-f42.google.com with SMTP id k14so11612oag.15
        for <std-proposals@isocpp.org>; Tue, 22 Oct 2013 15:56:44 -0700 (PDT)
X-Received: by 10.60.52.81 with SMTP id r17mr4055709oeo.3.1382482604654; Tue,
 22 Oct 2013 15:56:44 -0700 (PDT)
Original-Received: by 10.182.87.37 with HTTP; Tue, 22 Oct 2013 15:56:04 -0700 (PDT)
In-Reply-To: <4ceba2fe-c45d-4eba-ba2e-59f1a0892393@isocpp.org>
X-Original-Sender: billy.oneal@gmail.com
X-Original-Authentication-Results: mx.google.com;       spf=pass (google.com:
 domain of billy.oneal@gmail.com designates 2607:f8b0:4003:c02::22a as
 permitted sender) smtp.mail=billy.oneal@gmail.com;       dkim=pass
 header.i=@gmail.com;       dmarc=pass (p=NONE dis=NONE) header.from=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>, <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:7433
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/7433>

--001a1133073a8f07f404e95c5023
Content-Type: text/plain; charset=KOI8-R
Content-Transfer-Encoding: quoted-printable

> if such a function is declared as a non-member function it usually
returns a new object.

I disagree with that. Example: std::swap.

Billy O'Neal
https://github.com/BillyONeal/ <https://bitbucket.org/BillyONeal/>
http://stackoverflow.com/users/82320/billy-oneal
Malware Response Instructor - BleepingComputer.com


On Tue, Oct 22, 2013 at 1:52 PM, Vlad from Moscow <vlad.moscow@mail.ru>wrot=
e:

> At least because as a general rule if a function that  deals with
> two objects and is declared as a member function it usually
> returns reference to "this" object. On the other hand, if such a function
> is declared as a non-member function it usually returns a new object.
> Moreover this call
>
> append( v, { a, 2, 3, 4 } );
>
> looks like two containers are used so any reader can not exclude that the
> function is declared as
>
> std::vector<int> append( const std::vector<int> &v1, const
> std::vector<int> &v2 );
>
> A non-member function append looks like operator overloading in C# where
> overloaded operators are declared as static member functions and return a
> new object.
>
> =D3=D2=C5=C4=C1, 23 =CF=CB=D4=D1=C2=D2=D1 2013 =C7., 0:18:42 UTC+4 =D0=CF=
=CC=D8=DA=CF=D7=C1=D4=C5=CC=D8 Billy O'Neal =CE=C1=D0=C9=D3=C1=CC:
>
>> I don't see why
>> append( v, { 1, 2, 3, 4 } )
>> raises any more question about what is actually returned when compared
>> with
>> v.append( { 1, 2, 3, 4 } )
>>
>> Billy O'Neal
>> https://github.com/BillyONeal/ <https://bitbucket.org/BillyONeal/>
>> http://stackoverflow.com/**users/82320/billy-oneal<http://stackoverflow.=
com/users/82320/billy-oneal>
>> Malware Response Instructor - BleepingComputer.com
>>
>>
>> On Tue, Oct 22, 2013 at 1:17 PM, Vlad from Moscow <vlad....@mail.ru>wrot=
e:
>>
>>> If v.append( /*...*/ ) indeed will not return the vector itself then I
>>> could agree with you that a non-member function can be introduced. But =
in
>>> my opinion only this call
>>>
>>> append( v, { 1, 2, 3, 4 } )
>>>
>>> can arise a question what is actually returned.
>>>
>>> =D3=D2=C5=C4=C1, 23 =CF=CB=D4=D1=C2=D2=D1 2013 =C7., 0:09:59 UTC+4 =D0=
=CF=CC=D8=DA=CF=D7=C1=D4=C5=CC=D8 Billy O'Neal
>>> =CE=C1=D0=C9=D3=C1=CC:
>>>
>>>> >From the second call it is not clear what is outputed whether it is a
>>>> new vector or it is the original vector.
>>>>
>>>> I disagree. You can use nonmember append with basic_string, and the
>>>> name "append" implies modifying the original vector. There's nothing a=
bout
>>>> the syntactical difference between member and nommember functions whic=
h
>>>> clearly indicates "this modifies" or "this does not modify".
>>>>
>>>> That is, there's no reason "v.append(xyz)" doesn't return a different
>>>> vector either, by this logic.
>>>>
>>>> Billy O'Neal
>>>> https://github.com/BillyONeal/ <https://bitbucket.org/BillyONeal/>
>>>> http://stackoverflow.com/**users**/82320/billy-oneal<http://stackoverf=
low.com/users/82320/billy-oneal>
>>>> Malware Response Instructor - BleepingComputer.com
>>>>
>>>>
>>>> On Tue, Oct 22, 2013 at 1:03 PM, Vlad from Moscow <vlad....@mail.ru>wr=
ote:
>>>>
>>>>>
>>>>> In this case you can not substituted a call of the method for
>>>>> std::basic_string with a call for a vector. So the interface will not=
 be
>>>>> consistent.
>>>>>
>>>>> Apart from this the call
>>>>>
>>>>> std::cout << v.append( { 1, 2, 3, 4, 5 } );
>>>>>
>>>>> looks semantically more clear than
>>>>>
>>>>> std::cout << append( v, { 1, 2, 3, 4, 5 } );
>>>>>
>>>>> From the second call it is not clear what is outputed whether it is a
>>>>> new vector or it is the original vector.
>>>>>
>>>>> =D7=D4=CF=D2=CE=C9=CB, 22 =CF=CB=D4=D1=C2=D2=D1 2013 =C7., 21:37:19 U=
TC+4 =D0=CF=CC=D8=DA=CF=D7=C1=D4=C5=CC=D8 Billy O'Neal
>>>>> =CE=C1=D0=C9=D3=C1=CC:
>>>>>
>>>>>> I suppose I understand why there's no append here -- append on
>>>>>> basic_string is the same thing effectively as operator+=3D -- but th=
ere's no
>>>>>> such semantic operation that makes sense for vector.
>>>>>>
>>>>>> I suppose there's no reason for someone who wants this semantic not
>>>>>> to do:
>>>>>>
>>>>>> template <typename T, typename InputIterator>
>>>>>> T& append(T& container, InputIterator first, InputIterator last)
>>>>>> {
>>>>>>     container.insert(container.**end****(), first, last);
>>>>>>     return container;
>>>>>> }
>>>>>>
>>>>>> Billy O'Neal
>>>>>> https://github.com/BillyONeal/ <https://bitbucket.org/BillyONeal/>
>>>>>>  http://stackoverflow.com/**users****/82320/billy-oneal<http://stack=
overflow.com/users/82320/billy-oneal>
>>>>>> Malware Response Instructor - BleepingComputer.com
>>>>>>
>>>>>>
>>>>>> On Tue, Oct 22, 2013 at 5:04 AM, Vlad from Moscow <vlad....@mail.ru>=
wrote:
>>>>>>
>>>>>>>  Taking into account method append of std::basic_string it is not a
>>>>>>> new name. append and insert will have differenct semantic. append w=
ill
>>>>>>> return reference to the container itself. So you can use it for exa=
mple the
>>>>>>> follwoing way
>>>>>>>
>>>>>>> std::vector<int> v =3D { 1, 2, 3, 4, 5 };
>>>>>>>
>>>>>>> for ( int x : v.append( { 4, 3, 2, 1 } ) ) std::cout << x << ' ';
>>>>>>>
>>>>>>> insert is used then you need the position after inserting new
>>>>>>> elements. For example
>>>>>>>
>>>>>>> auto pos =3D v.end();
>>>>>>>
>>>>>>> pos =3D v.insert( pos, { 4, 3, 2, 1 } );
>>>>>>> v.insert( pos, 5 );
>>>>>>>
>>>>>>> =D7=D4=CF=D2=CE=C9=CB, 22 =CF=CB=D4=D1=C2=D2=D1 2013 =C7., 11:56:50=
 UTC+4 =D0=CF=CC=D8=DA=CF=D7=C1=D4=C5=CC=D8 Bengt
>>>>>>> Gustafsson =CE=C1=D0=C9=D3=C1=CC:
>>>>>>>
>>>>>>>> I think the idea is good, this use case appears quite often. But
>>>>>>>> why not overload push_back with more signatures instead of introdu=
cing a
>>>>>>>> new name? The signatures available would then be exactly parallel =
to
>>>>>>>> insert(), with the difference that the first parameter is absent.
>>>>>>>>
>>>>>>>>
>>>>>>>> Den tisdagen den 22:e oktober 2013 kl. 01:20:59 UTC+2 skrev Evgeny
>>>>>>>> Panasyuk:
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> No, I do not think so.
>>>>>>>>>>
>>>>>>>>>
>>>>>>>>> Why not?
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>> It is common interface of all sequential containers including an=
d
>>>>>>>>>> together with std::basic_string.
>>>>>>>>>>
>>>>>>>>>
>>>>>>>>> Just read GotW #84.
>>>>>>>>> std::string has many controversial design decisions. We should no=
t
>>>>>>>>> uglify STL by borrowing bad stuff from std::string.
>>>>>>>>>
>>>>>>>>  --
>>>>>>>
>>>>>>> ---
>>>>>>> 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-proposal...@**isocpp.org.
>>>>>>> To post to this group, send email to std-pr...@isocpp.org.
>>>>>>>
>>>>>>> Visit this group at http://groups.google.com/a/**iso****
>>>>>>> cpp.org/group/std-**proposals/<http://groups.google.com/a/isocpp.or=
g/group/std-proposals/>
>>>>>>> .
>>>>>>>
>>>>>>
>>>>>>  --
>>>>>
>>>>> ---
>>>>> 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, sen=
d
>>>>> an email to std-proposal...@**isocpp.org.
>>>>> To post to this group, send email to std-pr...@isocpp.org.
>>>>> Visit this group at http://groups.google.com/a/**iso**
>>>>> cpp.org/group/std-**proposals/<http://groups.google.com/a/isocpp.org/=
group/std-proposals/>
>>>>> .
>>>>>
>>>>
>>>>  --
>>>
>>> ---
>>> 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-proposal...@**isocpp.org.
>>> To post to this group, send email to std-pr...@isocpp.org.
>>> Visit this group at http://groups.google.com/a/**isocpp.org/group/std-*=
*
>>> proposals/ <http://groups.google.com/a/isocpp.org/group/std-proposals/>=
..
>>>
>>
>>  --
>
> ---
> 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/.
>

--=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/.

--001a1133073a8f07f404e95c5023
Content-Type: text/html; charset=KOI8-R
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div>&gt; if=9Asuch a function is declared as a non-member=
 function it usually returns a new object.</div><div><br></div><div>I disag=
ree with that. Example: std::swap.</div></div><div class=3D"gmail_extra"><b=
r clear=3D"all">

<div><div dir=3D"ltr"><div>Billy O&#39;Neal</div><div><a href=3D"https://bi=
tbucket.org/BillyONeal/" target=3D"_blank">https://github.com/BillyONeal/</=
a></div><div><a href=3D"http://stackoverflow.com/users/82320/billy-oneal" t=
arget=3D"_blank">http://stackoverflow.com/users/82320/billy-oneal</a></div>

<div>Malware Response Instructor - BleepingComputer.com</div></div></div>
<br><br><div class=3D"gmail_quote">On Tue, Oct 22, 2013 at 1:52 PM, Vlad fr=
om Moscow <span dir=3D"ltr">&lt;<a href=3D"mailto:vlad.moscow@mail.ru" targ=
et=3D"_blank">vlad.moscow@mail.ru</a>&gt;</span> wrote:<br><blockquote clas=
s=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;pad=
ding-left:1ex">

<div dir=3D"ltr"><div>At least because=9Aas a general rule if a function th=
at=9A=9Adeals with two=9Aobjects=9Aand is=9Adeclared as a member function i=
t usually returns=9Areference to=9A&quot;this&quot; object. On the other ha=
nd, if=9Asuch a function is declared as a non-member function it usually re=
turns a new object.=9A</div>

<div>Moreover this call</div><div>=9A</div><div>append( v, { a, 2, 3, 4 } )=
;</div><div>=9A</div><div>looks like two containers are used so any reader =
can not exclude that the function is=9Adeclared as</div><div>=9A</div><div>=
std::vector&lt;int&gt; append( const std::vector&lt;int&gt; &amp;v1, const =
std::vector&lt;int&gt; &amp;v2 );</div>

<div>=9A</div><div>A non-member function append looks like=9Aoperator overl=
oading in C# where overloaded operators are declared as static member funct=
ions and return a new object.</div><div><br>=D3=D2=C5=C4=C1, 23 =CF=CB=D4=
=D1=C2=D2=D1 2013=9A=C7., 0:18:42 UTC+4 =D0=CF=CC=D8=DA=CF=D7=C1=D4=C5=CC=
=D8 Billy O&#39;Neal =CE=C1=D0=C9=D3=C1=CC:</div>

<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-l=
eft-style:solid"><div class=3D"im"><div dir=3D"ltr"><div>I don&#39;t see wh=
y </div>

<div>append( v, { 1, 2, 3, 4 } )</div><div>raises any more question about w=
hat is actually returned when compared with</div><div>v.append( { 1, 2, 3, =
4 } )</div></div></div><div><div class=3D"im">

<br clear=3D"all"><div><div dir=3D"ltr"><div>Billy O&#39;Neal</div><div><a =
href=3D"https://bitbucket.org/BillyONeal/" target=3D"_blank">https://github=
..com/BillyONeal/</a></div><div><a href=3D"http://stackoverflow.com/users/82=
320/billy-oneal" target=3D"_blank">http://stackoverflow.com/<u></u>users/82=
320/billy-oneal</a></div>



<div>Malware Response Instructor - BleepingComputer.com</div></div></div>
<br><br></div><div><div class=3D"h5"><div class=3D"gmail_quote">On Tue, Oct=
 22, 2013 at 1:17 PM, Vlad from Moscow <span dir=3D"ltr">&lt;<a>vlad....@ma=
il.ru</a>&gt;</span> wrote:<br><blockquote class=3D"gmail_quote" style=3D"m=
argin: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>If v.append( /*...*/ ) indeed will not return the vec=
tor itself then I could agree with you that a non-member function can be in=
troduced. But in my opinion only this call</div><div>=9A</div><div>append( =
v, { 1, 2, 3, 4 } )</div>



<div>=9A</div><div>can arise a question what is actually returned.</div><di=
v><br>=D3=D2=C5=C4=C1, 23 =CF=CB=D4=D1=C2=D2=D1 2013=9A=C7., 0:09:59 UTC+4 =
=D0=CF=CC=D8=DA=CF=D7=C1=D4=C5=CC=D8 Billy O&#39;Neal =CE=C1=D0=C9=D3=C1=CC=
:</div><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;b=
order-left-style:solid">



<div><div dir=3D"ltr"><div>&gt;From the second call it is not clear what is=
 outputed whether it is a new vector or it is the original vector.</div><di=
v><br></div><div>I disagree. You can use nonmember append with basic_string=
, and the name &quot;append&quot; implies modifying the original vector. Th=
ere&#39;s nothing about the syntactical difference between member and nomme=
mber functions which clearly indicates &quot;this modifies&quot; or &quot;t=
his does not modify&quot;.</div>





<div><br></div><div>That is, there&#39;s no reason &quot;v.append(xyz)&quot=
; doesn&#39;t return a different vector either, by this logic.</div></div><=
/div><div><div><br clear=3D"all"><div><div dir=3D"ltr"><div>Billy O&#39;Nea=
l</div>





<div><a href=3D"https://bitbucket.org/BillyONeal/" target=3D"_blank">https:=
//github.com/BillyONeal/</a></div><div><a href=3D"http://stackoverflow.com/=
users/82320/billy-oneal" target=3D"_blank">http://stackoverflow.com/<u></u>=
users<u></u>/82320/billy-oneal</a></div>





<div>Malware Response Instructor - BleepingComputer.com</div></div></div>
<br><br></div><div><div><div class=3D"gmail_quote">On Tue, Oct 22, 2013 at =
1:03 PM, Vlad from Moscow <span dir=3D"ltr">&lt;<a>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>=9A</div><div>In this case you can not substituted a =
call of the method for std::basic_string with a call for=9Aa vector. So the=
 interface will not be consistent. </div><div>=9A</div><div>Apart from this=
 the call</div>





<div>=9A</div><div>std::cout &lt;&lt; v.append( { 1, 2, 3, 4, 5 } );</div><=
div>=9A</div><div>looks semantically more clear than</div><div>=9A</div><di=
v>std::cout &lt;&lt; append( v, { 1, 2, 3, 4, 5 } );</div><div>=9A</div><di=
v>From the second call it is not clear what is outputed whether it is a new=
 vector or it is the original vector.</div>





<div><br>=D7=D4=CF=D2=CE=C9=CB, 22 =CF=CB=D4=D1=C2=D2=D1 2013=9A=C7., 21:37=
:19 UTC+4 =D0=CF=CC=D8=DA=CF=D7=C1=D4=C5=CC=D8 Billy O&#39;Neal =CE=C1=D0=
=C9=D3=C1=CC:</div><blockquote class=3D"gmail_quote" style=3D"margin:0px 0p=
x 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>I suppose I understand why there&#39;s no append here=
 -- append on basic_string is the same thing effectively as operator+=3D --=
 but there&#39;s no such semantic operation that makes sense for vector.<di=
v>





<br>

</div><div>I suppose there&#39;s no reason for someone who wants this seman=
tic not to do:</div><div><br></div><div>template &lt;typename T, typename I=
nputIterator&gt;</div><div>T&amp; append(T&amp; container, InputIterator fi=
rst, InputIterator last)</div>







<div>{</div><div>=9A =9A container.insert(container.<u></u>end<u></u><u></u=
>(), first, last);</div><div>=9A =9A return container;</div><div>}</div></d=
iv><div><div><div><br clear=3D"all"><div><div dir=3D"ltr"><div>Billy O&#39;=
Neal</div>



<div><a href=3D"https://bitbucket.org/BillyONeal/" target=3D"_blank">https:=
//github.com/BillyONeal/</a></div>

<div>
<a href=3D"http://stackoverflow.com/users/82320/billy-oneal" target=3D"_bla=
nk">http://stackoverflow.com/<u></u>users<u></u><u></u>/82320/billy-oneal</=
a></div><div>Malware Response Instructor - BleepingComputer.com</div></div>

</div>


<br><br></div><div class=3D"gmail_quote"><div>On Tue, Oct 22, 2013 at 5:04 =
AM, Vlad from Moscow <span dir=3D"ltr">&lt;<a>vlad....@mail.ru</a>&gt;</spa=
n> wrote:<br></div><blockquote class=3D"gmail_quote" style=3D"margin:0px 0p=
x 0px 0.8ex;padding-left:1ex;border-left-color:rgb(204,204,204);border-left=
-width:1px;border-left-style:solid">





<div>


<div dir=3D"ltr"><div>Taking into account method append of std::basic_strin=
g it is not a new name. append and insert will have differenct semantic. ap=
pend will return reference to the container itself. So you can use it for e=
xample the follwoing way</div>








<div>=9A</div><div>std::vector&lt;int&gt; v =3D { 1, 2, 3, 4, 5 };</div><di=
v>=9A</div><div>for ( int x=9A: v.append( { 4, 3, 2, 1 } ) ) std::cout &lt;=
&lt; x &lt;&lt; &#39; &#39;;</div><div>=9A</div><div>insert is used then yo=
u need the position after inserting new elements. For example</div>








<div>=9A</div><div>auto pos =3D v.end();</div><div>=9A</div><div>pos =3D v.=
insert( pos, { 4, 3, 2, 1 } );</div><div>v.insert( pos,=9A5 );</div><div><b=
r>=D7=D4=CF=D2=CE=C9=CB, 22 =CF=CB=D4=D1=C2=D2=D1 2013=9A=C7., 11:56:50 UTC=
+4 =D0=CF=CC=D8=DA=CF=D7=C1=D4=C5=CC=D8 Bengt Gustafsson =CE=C1=D0=C9=D3=C1=
=CC:</div>








<div><div><blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8=
ex;padding-left:1ex;border-left-color:rgb(204,204,204);border-left-width:1p=
x;border-left-style:solid"><div dir=3D"ltr">I think the idea is good, this =
use case appears quite often. But why not overload push_back with more sign=
atures instead of introducing a new name? The signatures available would th=
en be exactly parallel to insert(), with the difference that the first para=
meter is absent.<div>








<br><br>Den tisdagen den 22:e oktober 2013 kl. 01:20:59 UTC+2 skrev Evgeny =
Panasyuk:<blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8e=
x;padding-left:1ex;border-left-color:rgb(204,204,204);border-left-width:1px=
;border-left-style:solid">








<div dir=3D"ltr"><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-le=
ft-width:1px;border-left-style:solid"><div dir=3D"ltr"><div>No, I do not th=
ink so.</div>








</div></blockquote><div><br>Why not?<br>=9A</div><blockquote class=3D"gmail=
_quote" style=3D"margin:0px 0px 0px 0.8ex;padding-left:1ex;border-left-colo=
r:rgb(204,204,204);border-left-width:1px;border-left-style:solid"><div dir=
=3D"ltr">








<div>It is common interface of all sequential containers=9Aincluding=9Aand =
together with std::basic_string.</div></div></blockquote><div><br>Just read=
 GotW #84.<br>std::string has many controversial design decisions. We shoul=
d not uglify STL by borrowing bad stuff from std::string.<br>








</div></div></blockquote></div></div></blockquote></div></div></div></div><=
div><div><div>

<p></p>

-- <br>
=9A<br>
--- <br>
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals&quot; group.<br></div>
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to <a>std-proposal...@<u></u>isocpp.org</a>.<br>
To post to this group, send email to <a>std-pr...@isocpp.org</a>.<div><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/<u></u>iso<u><=
/u><u></u>cpp.org/group/std-<u></u>proposals/</a>.<br>
</div></div></div></blockquote></div><br></div></div></div>
</blockquote></div><div><div>

<p></p>

-- <br>
=9A<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 <a>std-proposal...@<u></u>isocpp.org</a>.<br>
To post to this group, send email to <a>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/<u></u>iso<u><=
/u>cpp.org/group/std-<u></u>proposals/</a>.<br>
</div></div></blockquote></div><br></div></div></div>
</blockquote></div><div><div>

<p></p>

-- <br>
=9A<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 <a>std-proposal...@<u></u>isocpp.org</a>.<br>
To post to this group, send email to <a>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/<u></u>isocpp.=
org/group/std-<u></u>proposals/</a>.<br>
</div></div></blockquote></div><br></div></div></div>
</blockquote></div><div class=3D"HOEnZb"><div class=3D"h5">

<p></p>

-- <br>
=9A<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 <a href=3D"mailto:std-proposals%2Bunsubscribe@isocpp.org" target=3D=
"_blank">std-proposals+unsubscribe@isocpp.org</a>.<br>
To post to this group, send email to <a href=3D"mailto:std-proposals@isocpp=
..org" target=3D"_blank">std-proposals@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/isocpp.org/gro=
up/std-proposals/</a>.<br>
</div></div></blockquote></div><br></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 />

--001a1133073a8f07f404e95c5023--

.
