220 7408 <CAPBZbvxbNhQX2LPNj+3aTjkLFa_1DNVWJK=1EZ4_UYh2OZg8UQ@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 13:13:40 -0700
Lines: 173
Approved: news@gmane.org
Message-ID: <CAPBZbvxbNhQX2LPNj+3aTjkLFa_1DNVWJK=1EZ4_UYh2OZg8UQ@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> <a4621591-b5c7-4e94-af92-3009d647512f@isocpp.org>
 <e77e47bc-10fb-4f87-ac92-082dcd04b68a@isocpp.org> <9d4555bb-fa09-4146-9f76-1d8f5cdd1fdf@isocpp.org>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: plane.gmane.org
Mime-Version: 1.0
Content-Type: multipart/alternative; boundary=001a11c2ff58cb92e004e95a0bfb
X-Trace: ger.gmane.org 1382472857 27963 80.91.229.3 (22 Oct 2013 20:14:17 GMT)
X-Complaints-To: usenet@ger.gmane.org
NNTP-Posting-Date: Tue, 22 Oct 2013 20:14:17 +0000 (UTC)
To: std-proposals <std-proposals@isocpp.org>
Original-X-From: std-proposals+bncBDKLBLVE6ADBBHNZTOJQKGQEMAMWDSY@isocpp.org Tue Oct 22 22:14:23 2013
Return-path: <std-proposals+bncBDKLBLVE6ADBBHNZTOJQKGQEMAMWDSY@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-ie0-f200.google.com ([209.85.223.200])
	by plane.gmane.org with esmtp (Exim 4.69)
	(envelope-from <std-proposals+bncBDKLBLVE6ADBBHNZTOJQKGQEMAMWDSY@isocpp.org>)
	id 1VYiLO-0003Le-SD
	for gclcip-std-proposals@m.gmane.org; Tue, 22 Oct 2013 22:14:23 +0200
Original-Received: by mail-ie0-f200.google.com with SMTP id aq17sf4163887iec.3
        for <gclcip-std-proposals@m.gmane.org>; Tue, 22 Oct 2013 13:14:21 -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=0CZ71hA7wexkgIQu1Uk9wv/m8Z6+va8MBeVYxqxkf9M=;
        b=dRSeYpObPQ9Rl+Ha3Y+Um2hHPCOByzKcfPAsLj0DnVuPY6ePAjA6l4yjL1Y/Yqi38m
         UMWATOvKa6g6R6X9d7KJ2NukKh0T0BsBKZZzD3PCEmU86OAaiN1Sajob6XDrOKTJ446i
         ATvPhzmW6kYjbXK4ITaS4KgzUhHqKKOr99uAg/QxMa9jwEPbykVFxX0Ogr1pjpr4HZU3
         S4vS5Bq/tX+FXUzwCt/vEVRG64cAKE0QFcqk3HQYafyMNQ7w26Ta1qvM+4lTwiyOCtyk
         eWZHLtVlKboGT1Plig0t6pSmTb0uldgSjbdjFqdd6ZYMbRIj2QgjbE64+vIU82q4jV/A
         ajuA==
X-Received: by 10.50.114.66 with SMTP id je2mr7970613igb.5.1382472861819;
        Tue, 22 Oct 2013 13:14:21 -0700 (PDT)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.182.29.229 with SMTP id n5ls132466obh.66.gmail; Tue, 22 Oct
 2013 13:14:21 -0700 (PDT)
X-Received: by 10.60.39.169 with SMTP id q9mr1507926oek.79.1382472861355;
        Tue, 22 Oct 2013 13:14:21 -0700 (PDT)
Original-Received: from mail-oa0-x22d.google.com (mail-oa0-x22d.google.com [2607:f8b0:4003:c02::22d])
        by mx.google.com with ESMTPS id ds9si15882414obc.125.2013.10.22.13.14.21
        for <std-proposals@isocpp.org>
        (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128);
        Tue, 22 Oct 2013 13:14:21 -0700 (PDT)
Received-SPF: pass (google.com: domain of billy.oneal@gmail.com designates 2607:f8b0:4003:c02::22d as permitted sender) client-ip=2607:f8b0:4003:c02::22d;
Original-Received: by mail-oa0-f45.google.com with SMTP id i4so7097630oah.18
        for <std-proposals@isocpp.org>; Tue, 22 Oct 2013 13:14:21 -0700 (PDT)
X-Received: by 10.60.51.99 with SMTP id j3mr2805103oeo.49.1382472861060; Tue,
 22 Oct 2013 13:14:21 -0700 (PDT)
Original-Received: by 10.182.87.37 with HTTP; Tue, 22 Oct 2013 13:13:40 -0700 (PDT)
In-Reply-To: <9d4555bb-fa09-4146-9f76-1d8f5cdd1fdf@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::22d 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:7408
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/7408>

--001a11c2ff58cb92e004e95a0bfb
Content-Type: text/plain; charset=KOI8-R
Content-Transfer-Encoding: quoted-printable

> if to do so the question arises what to do with arrays
You should not be able to append to arrays. An append is a length changing
operation, and arrays are fixed size.

>Also what to do with other containers that also have no method insert as
for example std::forward_list?
Use tag dispatch for forward_list to call insert_after instead.

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:11 PM, Vlad from Moscow <vlad.moscow@mail.ru>wrot=
e:

> As I said I do not see a great sense to make the method as a non-member
> function. In my opinion it is a wrong approach because if to do so the
> question arises what to do with arrays. They have no method insert. Also
> what to do with other containers that also have no method insert as for
> example std::forward_list?
>
> =D7=D4=CF=D2=CE=C9=CB, 22 =CF=CB=D4=D1=C2=D2=D1 2013 =C7., 21:38:05 UTC+4=
 =D0=CF=CC=D8=DA=CF=D7=C1=D4=C5=CC=D8 Evgeny Panasyuk
> =CE=C1=D0=C9=D3=C1=CC:
>
>>
>>> I do not see any great sense in this function. In fact you need to
>>> write its realization for each container. So it looks like the realizat=
ion
>>> of function std:;swap in containers. Moreover std::basic_string has
>>> already method append. So that to make the call of the function
>>> interchangeable with other containers it is better to make it a class
>>> member.
>>>
>>
>> Non-member append/push_back is easily implementable in terms of end()
>> (which is part of Container concept requirnment since 1998) and insert(.=
...)
>> (which is part of Sequence concept requirenment since 1998).
>> Once such function will be implemented as non-member it would work with
>> any conformant sequence automaticly. That is not only about STL containe=
rs,
>> but also about containers which users developed themself since 1998.
>> Just look at http://www.boost.org/doc/libs/**1_54_0/libs/range/doc/html/=
*
>> *range/reference/algorithms/**new/push_back.html<http://www.boost.org/do=
c/libs/1_54_0/libs/range/doc/html/range/reference/algorithms/new/push_back.=
html>
>>
>>  --
>
> ---
> 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/.

--001a11c2ff58cb92e004e95a0bfb
Content-Type: text/html; charset=KOI8-R
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div>&gt; if to do so the question arises what to do with =
arrays</div><div>You should not be able to append to arrays. An append is a=
 length changing operation, and arrays are fixed size.</div><div><br></div>

<div>&gt;Also what to do with other containers that also have no method ins=
ert as for example std::forward_list?</div><div>Use tag dispatch for forwar=
d_list to call insert_after instead.</div></div><div class=3D"gmail_extra">

<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/users/82320/bil=
ly-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:11 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>As I said I do not see a great sense to make the meth=
od as a non-member function. In my opinion it is a wrong approach because i=
f to do so the question arises what to do with arrays. They have no method =
insert. Also what to do with other containers that also have no method inse=
rt as for example std::forward_list?</div>

<div><br>=D7=D4=CF=D2=CE=C9=CB, 22 =CF=CB=D4=D1=C2=D2=D1 2013=9A=C7., 21:38=
:05 UTC+4 =D0=CF=CC=D8=DA=CF=D7=C1=D4=C5=CC=D8 Evgeny Panasyuk =CE=C1=D0=C9=
=D3=C1=CC:</div><div><div class=3D"h5"><blockquote class=3D"gmail_quote" st=
yle=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"><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-w=
idth:1px;border-left-style:solid"><div dir=3D"ltr"><div>=9A</div><div>I do =
not see any great sense in this function. In fact you need to write=9Aits r=
ealization for each container. So it looks like the realization of function=
 std:;swap in containers. Moreover std::basic_string has already=9Amethod a=
ppend. So that to make the call of the function interchangeable with other =
containers it is better to make it a class member.</div>

</div></blockquote><div>=9A<br>Non-member append/push_back is easily implem=
entable in terms of end() (which is part of Container concept requirnment s=
ince 1998) and insert(...) (which is part of Sequence concept requirenment =
since 1998).<br>

Once such function will be implemented as non-member it would work with any=
 conformant sequence automaticly. That is not only about STL containers, bu=
t also about containers which users developed themself since 1998.<br>
Just look at <a href=3D"http://www.boost.org/doc/libs/1_54_0/libs/range/doc=
/html/range/reference/algorithms/new/push_back.html" target=3D"_blank">http=
://www.boost.org/doc/libs/<u></u>1_54_0/libs/range/doc/html/<u></u>range/re=
ference/algorithms/<u></u>new/push_back.html</a><br>

<br></div></div></blockquote></div></div></div><div class=3D"HOEnZb"><div c=
lass=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 />

--001a11c2ff58cb92e004e95a0bfb--

.
