Topic: To add the method append for all sequential
Author: Vlad from Moscow <vlad.moscow@mail.ru>
Date: Sun, 20 Oct 2013 12:57:04 -0700 (PDT)
Raw View
------=_Part_2585_13499143.1382299024015
Content-Type: text/plain; charset=ISO-8859-1
I find out some inconvenience that sequential containers except
std::basic_string that have method push_back at the same time have no
method append.
For example it would be not bad to write
std::vector<int> v;
// processing of v
std::list<int> l;
// processing of l
v.append( l.begin(), l.end() );
Although the same can be done with method insert as for example
v.insert( v.end(), l.begin(), l.end() );
I would prefer to use append because it has more clear semantic and
interchangeable with method the append of std::basic_string.
I would like to make such a proposal.
Are any thoughts about adding the method append to sequantial containers?
--
---
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/.
------=_Part_2585_13499143.1382299024015
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr"><div>I find out some inconvenience that sequenti=
al containers except std::basic_string that have method push_back at the sa=
me time have no method append.</div><div> </div><div>For example it wo=
uld be not bad to write</div><div> </div><div>std::vector<int> v=
;</div><div>// processing of v</div><div> </div><div><div>std::list<=
;int> l;</div></div><div>// processing of l</div><div> </div><div>v=
..append( l.begin(), l.end() );</div><div> </div><div>Although the same=
can be done with method insert as for example</div><div> </div><=
div>v.insert( v.end(), l.begin(), l.end() );</div><div> </div><div>I w=
ould prefer to use append because it has more clear semantic and interchang=
eable with method the append of std::basic_string.</div><div> </div><d=
iv>I would like to make such a proposal.</div><div> </div><div>Are any=
thoughts about adding the method append to sequantial containers?</di=
v></div>
<p></p>
-- <br />
<br />
--- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals" 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_2585_13499143.1382299024015--
.
Author: "Billy O'Neal" <billy.oneal@gmail.com>
Date: Sun, 20 Oct 2013 20:48:17 -0700
Raw View
--001a1133073ae5880104e93829b6
Content-Type: text/plain; charset=ISO-8859-1
+1
Billy O'Neal
https://github.com/BillyONeal/ <https://bitbucket.org/BillyONeal/>
http://stackoverflow.com/users/82320/billy-oneal
Malware Response Instructor - BleepingComputer.com
On Sun, Oct 20, 2013 at 12:57 PM, Vlad from Moscow <vlad.moscow@mail.ru>wrote:
> I find out some inconvenience that sequential containers except
> std::basic_string that have method push_back at the same time have no
> method append.
>
> For example it would be not bad to write
>
> std::vector<int> v;
> // processing of v
>
> std::list<int> l;
> // processing of l
>
> v.append( l.begin(), l.end() );
>
> Although the same can be done with method insert as for example
>
> v.insert( v.end(), l.begin(), l.end() );
>
> I would prefer to use append because it has more clear semantic and
> interchangeable with method the append of std::basic_string.
>
> I would like to make such a proposal.
>
> Are any thoughts about adding the method append to sequantial containers?
>
> --
>
> ---
> 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/.
>
--
---
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/.
--001a1133073ae5880104e93829b6
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr">+1</div><div class=3D"gmail_extra"><br clear=3D"all"><div>=
<div dir=3D"ltr"><div>Billy O'Neal</div><div><a href=3D"https://bitbuck=
et.org/BillyONeal/" target=3D"_blank">https://github.com/BillyONeal/</a></d=
iv><div><a href=3D"http://stackoverflow.com/users/82320/billy-oneal" target=
=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 Sun, Oct 20, 2013 at 12:57 PM, Vlad f=
rom Moscow <span dir=3D"ltr"><<a href=3D"mailto:vlad.moscow@mail.ru" tar=
get=3D"_blank">vlad.moscow@mail.ru</a>></span> wrote:<br><blockquote cla=
ss=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;pa=
dding-left:1ex">
<div dir=3D"ltr"><div>I=A0find out=A0some inconvenience that sequential con=
tainers except std::basic_string that have method push_back at the same tim=
e have no method append.</div><div>=A0</div><div>For example it would be no=
t bad to write</div>
<div>=A0</div><div>std::vector<int> v;</div><div>// processing of v</=
div><div>=A0</div><div><div>std::list<int> l;</div></div><div>// proc=
essing of l</div><div>=A0</div><div>v.append( l.begin(), l.end() );</div><d=
iv>
=A0</div><div>Although the same can be=A0done with method insert as for exa=
mple</div><div>=A0</div><div>v.insert( v.end(), l.begin(), l.end() );</div>=
<div>=A0</div><div>I would prefer to use append because it has more clear s=
emantic and interchangeable with method the append of std::basic_string.</d=
iv>
<div>=A0</div><div>I would like to make such a proposal.</div><div>=A0</div=
><div>Are any thoughts about adding the method append=A0to sequantial conta=
iners?</div></div><span class=3D"HOEnZb"><font color=3D"#888888">
<p></p>
-- <br>
=A0<br>
--- <br>
You received this message because you are subscribed to the Google Groups &=
quot;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"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>
</font></span></blockquote></div><br></div>
<p></p>
-- <br />
<br />
--- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals" 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 />
--001a1133073ae5880104e93829b6--
.
Author: =?UTF-8?Q?Klaim_=2D_Jo=C3=ABl_Lamotte?= <mjklaim@gmail.com>
Date: Tue, 22 Oct 2013 00:25:40 +0200
Raw View
--001a11c2de60a19ff304e947c366
Content-Type: text/plain; charset=ISO-8859-1
+1 too, I'm getting in this use case very often and clarifying would help
(btw doesn't it suggests more information to the implementation to use for
potential optimizations?).
--
---
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/.
--001a11c2de60a19ff304e947c366
Content-Type: text/html; charset=ISO-8859-1
<div dir="ltr">+1 too, I'm getting in this use case very often and clarifying would help (btw doesn't it suggests more information to the implementation to use for potential optimizations?).</div>
<p></p>
-- <br />
<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 email 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="http://groups.google.com/a/isocpp.org/group/std-proposals/">http://groups.google.com/a/isocpp.org/group/std-proposals/</a>.<br />
--001a11c2de60a19ff304e947c366--
.
Author: Vlad from Moscow <vlad.moscow@mail.ru>
Date: Mon, 21 Oct 2013 16:00:14 -0700 (PDT)
Raw View
------=_Part_2838_32557828.1382396414769
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
I think that three overloaded functions could be provided for the method=20
append. They are
=20
append( size_type n, const T &value );
=20
template <class InputIterator>
append( InputIterator first, InputIterator last );
=20
append( initializer_list<T> );
=20
I have not specified the return type because opposite to method insert I=20
would propose that the method append would return reference to the=20
container itself.
=20
The question regarding to the return type should be discussed.
=20
=D0=B2=D1=82=D0=BE=D1=80=D0=BD=D0=B8=D0=BA, 22 =D0=BE=D0=BA=D1=82=D1=8F=D0=
=B1=D1=80=D1=8F 2013 =D0=B3., 2:25:40 UTC+4 =D0=BF=D0=BE=D0=BB=D1=8C=D0=B7=
=D0=BE=D0=B2=D0=B0=D1=82=D0=B5=D0=BB=D1=8C Klaim - Jo=C3=ABl=20
Lamotte =D0=BD=D0=B0=D0=BF=D0=B8=D1=81=D0=B0=D0=BB:
> +1 too, I'm getting in this use case very often and clarifying would help=
=20
> (btw doesn't it suggests more information to the implementation to use fo=
r=20
> potential optimizations?).
>
--=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_2838_32557828.1382396414769
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr"><div>I think that three overloaded functions could be prov=
ided for the method append. They are</div><div> </div><div>append( siz=
e_type n, const T &value );</div><div> </div><div>template <cla=
ss InputIterator></div><div>append( InputIterator first, InputIterator l=
ast );</div><div> </div><div>append( initializer_list<T> );</div=
><div> </div><div>I have not specified the return type because opposit=
e to method insert I would propose that the method append would return=
reference to the container itself.</div><div> </div><div>The question=
regarding to the return type should be discussed.</div><div> </div><d=
iv><br>=D0=B2=D1=82=D0=BE=D1=80=D0=BD=D0=B8=D0=BA, 22 =D0=BE=D0=BA=D1=82=D1=
=8F=D0=B1=D1=80=D1=8F 2013 =D0=B3., 2:25:40 UTC+4 =D0=BF=D0=BE=D0=BB=
=D1=8C=D0=B7=D0=BE=D0=B2=D0=B0=D1=82=D0=B5=D0=BB=D1=8C Klaim - Jo=C3=ABl La=
motte =D0=BD=D0=B0=D0=BF=D0=B8=D1=81=D0=B0=D0=BB:</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-left-style:=
solid;"><div dir=3D"ltr">+1 too, I'm getting in this use case very often a=
nd clarifying would help (btw doesn't it suggests more information to the i=
mplementation to use for potential optimizations?).</div>
</blockquote></div>
<p></p>
-- <br />
<br />
--- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals" 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_2838_32557828.1382396414769--
.
Author: Evgeny Panasyuk <evgeny.panasyuk@gmail.com>
Date: Mon, 21 Oct 2013 16:06:33 -0700 (PDT)
Raw View
------=_Part_487_14117035.1382396793717
Content-Type: text/plain; charset=ISO-8859-1
>
> Are any thoughts about adding the method append to sequantial containers?
>
It should be non-member function. Just like boost::range::push_back -
http://www.boost.org/doc/libs/1_54_0/libs/range/doc/html/range/reference/algorithms/new/push_back.html
Also read - http://www.gotw.ca/gotw/084.htm
--
---
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/.
------=_Part_487_14117035.1382396793717
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr"><blockquote class=3D"gmail_quote" style=3D"margin: 0;margi=
n-left: 0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;"><div dir=3D"l=
tr"><div>Are any thoughts about adding the method append to sequantial=
containers?</div></div></blockquote><div><br>It should be non-member funct=
ion. Just like boost::range::push_back - http://www.boost.org/doc/libs/1_54=
_0/libs/range/doc/html/range/reference/algorithms/new/push_back.html<br>Als=
o read - http://www.gotw.ca/gotw/084.htm <br></div></div>
<p></p>
-- <br />
<br />
--- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals" 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_487_14117035.1382396793717--
.
Author: Vlad from Moscow <vlad.moscow@mail.ru>
Date: Mon, 21 Oct 2013 16:08:45 -0700 (PDT)
Raw View
------=_Part_615_1248788.1382396925685
Content-Type: text/plain; charset=KOI8-R
Content-Transfer-Encoding: quoted-printable
No, I do not think so. It is common interface of all sequential=20
containers including and together with std::basic_string.
=D7=D4=CF=D2=CE=C9=CB, 22 =CF=CB=D4=D1=C2=D2=D1 2013 =C7., 3:06:33 UTC+4 =
=D0=CF=CC=D8=DA=CF=D7=C1=D4=C5=CC=D8 Evgeny Panasyuk=20
=CE=C1=D0=C9=D3=C1=CC:
> Are any thoughts about adding the method append to sequantial containers?
>>
>
> It should be non-member function. Just like boost::range::push_back -=20
> http://www.boost.org/doc/libs/1_54_0/libs/range/doc/html/range/reference/=
algorithms/new/push_back.html
> Also read - http://www.gotw.ca/gotw/084.htm=20
>
--=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_615_1248788.1382396925685
Content-Type: text/html; charset=KOI8-R
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr"><div>No, I do not think so. It is common interface of all =
sequential containers including and together with std::basic_stri=
ng.</div><div><br>=D7=D4=CF=D2=CE=C9=CB, 22 =CF=CB=D4=D1=C2=D2=D1 2013 =
;=C7., 3:06:33 UTC+4 =D0=CF=CC=D8=DA=CF=D7=C1=D4=C5=CC=D8 Evgeny Panasyuk =
=CE=C1=D0=C9=D3=C1=CC:</div><blockquote class=3D"gmail_quote" style=3D"marg=
in: 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; paddin=
g-left: 1ex; border-left-color: rgb(204, 204, 204); border-left-width: 1px;=
border-left-style: solid;"><div dir=3D"ltr"><div>Are any thoughts about ad=
ding the method append to sequantial containers?</div></div></blockquo=
te><div><br>It should be non-member function. Just like boost::range::push_=
back - <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/<wbr>1_54_0/libs/range/doc/html/<wbr>range/reference/al=
gorithms/<wbr>new/push_back.html</a><br>Also read - <a href=3D"http://www.g=
otw.ca/gotw/084.htm" target=3D"_blank">http://www.gotw.ca/gotw/084.<wbr>htm=
</a> <br></div></div></blockquote></div>
<p></p>
-- <br />
<br />
--- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals" 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_615_1248788.1382396925685--
.
Author: Evgeny Panasyuk <evgeny.panasyuk@gmail.com>
Date: Mon, 21 Oct 2013 16:20:59 -0700 (PDT)
Raw View
------=_Part_648_14071639.1382397659300
Content-Type: text/plain; charset=ISO-8859-1
> No, I do not think so.
>
Why not?
> It is common interface of all sequential containers including and together
> with std::basic_string.
>
Just read GotW #84.
std::string has many controversial design decisions. We should not 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-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/.
------=_Part_648_14071639.1382397659300
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr"><br><blockquote class=3D"gmail_quote" style=3D"margin: 0;m=
argin-left: 0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;"><div dir=
=3D"ltr"><div>No, I do not think so.</div></div></blockquote><div><br>Why n=
ot?<br> </div><blockquote class=3D"gmail_quote" style=3D"margin: 0;mar=
gin-left: 0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;"><div dir=3D=
"ltr"><div>It is common interface of all sequential containers includi=
ng and together with std::basic_string.</div></div></blockquote><div><=
br>Just read GotW #84.<br>std::string has many controversial design decisio=
ns. We should not uglify STL by borrowing bad stuff from std::string.<br></=
div></div>
<p></p>
-- <br />
<br />
--- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals" 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_648_14071639.1382397659300--
.
Author: Bengt Gustafsson <bengt.gustafsson@beamways.com>
Date: Tue, 22 Oct 2013 00:56:50 -0700 (PDT)
Raw View
------=_Part_2386_6370675.1382428610944
Content-Type: text/plain; charset=ISO-8859-1
I think the idea is good, this use case appears quite often. But why not
overload push_back with more signatures instead of introducing 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 and
>> together with std::basic_string.
>>
>
> Just read GotW #84.
> std::string has many controversial design decisions. We should not 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-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/.
------=_Part_2386_6370675.1382428610944
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr">I think the idea is good, this use case appears quite ofte=
n. But why not overload push_back with more signatures instead of introduci=
ng a new name? The signatures available would then be exactly parallel to i=
nsert(), with the difference that the first parameter is absent.<div><br><b=
r>Den tisdagen den 22:e oktober 2013 kl. 01:20:59 UTC+2 skrev Evgeny Panasy=
uk:<blockquote class=3D"gmail_quote" style=3D"margin: 0;margin-left: 0.8ex;=
border-left: 1px #ccc solid;padding-left: 1ex;"><div dir=3D"ltr"><br><block=
quote class=3D"gmail_quote" style=3D"margin:0;margin-left:0.8ex;border-left=
:1px #ccc solid;padding-left:1ex"><div dir=3D"ltr"><div>No, I do not think =
so.</div></div></blockquote><div><br>Why not?<br> </div><blockquote cl=
ass=3D"gmail_quote" style=3D"margin:0;margin-left:0.8ex;border-left:1px #cc=
c solid;padding-left:1ex"><div dir=3D"ltr"><div>It is common interface of a=
ll sequential containers including and together with std::basic_s=
tring.</div></div></blockquote><div><br>Just read GotW #84.<br>std::string =
has many controversial design decisions. We should not uglify STL by borrow=
ing bad stuff from std::string.<br></div></div></blockquote></div></div>
<p></p>
-- <br />
<br />
--- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals" 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_2386_6370675.1382428610944--
.
Author: "Billy O'Neal" <billy.oneal@gmail.com>
Date: Tue, 22 Oct 2013 01:02:26 -0700
Raw View
--047d7b4724a2a6c79204e94fd41e
Content-Type: text/plain; charset=ISO-8859-1
1. Because adding overloads to an existing function name is a perilous
exercise :)
2. Because "push" means "add 1 item".
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 12:56 AM, Bengt Gustafsson <
bengt.gustafsson@beamways.com> wrote:
> I think the idea is good, this use case appears quite often. But why not
> overload push_back with more signatures instead of introducing 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 and
>>> together with std::basic_string.
>>>
>>
>> Just read GotW #84.
>> std::string has many controversial design decisions. We should not 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-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/.
>
--
---
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/.
--047d7b4724a2a6c79204e94fd41e
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr">1. Because adding overloads to an existing function name i=
s a perilous exercise :)<div>2. Because "push" means "add 1 =
item".</div></div><div class=3D"gmail_extra"><br clear=3D"all"><div><d=
iv dir=3D"ltr">
<div>Billy O'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"_blank">htt=
p://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 12:56 AM, Bengt =
Gustafsson <span dir=3D"ltr"><<a href=3D"mailto:bengt.gustafsson@beamway=
s.com" target=3D"_blank">bengt.gustafsson@beamways.com</a>></span> wrote=
:<br>
<blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1p=
x #ccc solid;padding-left:1ex"><div dir=3D"ltr">I think the idea is good, t=
his use case appears quite often. But why not overload push_back with more =
signatures instead of introducing a new name? The signatures available woul=
d then be exactly parallel to insert(), with the difference that the first =
parameter is absent.<div>
<br><br>Den tisdagen den 22:e oktober 2013 kl. 01:20:59 UTC+2 skrev Evgeny =
Panasyuk:<div><div class=3D"h5"><blockquote class=3D"gmail_quote" style=3D"=
margin:0;margin-left:0.8ex;border-left:1px #ccc solid;padding-left:1ex"><di=
v dir=3D"ltr">
<br><blockquote class=3D"gmail_quote" style=3D"margin:0;margin-left:0.8ex;b=
order-left:1px #ccc solid;padding-left:1ex"><div dir=3D"ltr"><div>No, I do =
not think so.</div></div></blockquote><div><br>Why not?<br>=A0</div><blockq=
uote class=3D"gmail_quote" style=3D"margin:0;margin-left:0.8ex;border-left:=
1px #ccc solid;padding-left:1ex">
<div dir=3D"ltr"><div>It is common interface of all sequential containers=
=A0including=A0and together with std::basic_string.</div></div></blockquote=
><div><br>Just read GotW #84.<br>std::string has many controversial design =
decisions. We should not uglify STL by borrowing bad stuff from std::string=
..<br>
</div></div></blockquote></div></div></div></div><div class=3D"HOEnZb"><div=
class=3D"h5">
<p></p>
-- <br>
=A0<br>
--- <br>
You received this message because you are subscribed to the Google Groups &=
quot;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"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 />
<br />
--- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals" 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 />
--047d7b4724a2a6c79204e94fd41e--
.
Author: Vlad from Moscow <vlad.moscow@mail.ru>
Date: Tue, 22 Oct 2013 04:57:31 -0700 (PDT)
Raw View
------=_Part_1833_23265141.1382443051263
Content-Type: text/plain; charset=KOI8-R
Content-Transfer-Encoding: quoted-printable
=20
I do not see any great sense in this function. In fact you need to=20
write its realization for each container. So it looks like the realization=
=20
of function std:;swap in containers. Moreover std::basic_string has=20
already method append. So that to make the call of the function=20
interchangeable with other containers it is better to make it a class=20
member.
..=20
=D7=D4=CF=D2=CE=C9=CB, 22 =CF=CB=D4=D1=C2=D2=D1 2013 =C7., 3:20:59 UTC+4 =
=D0=CF=CC=D8=DA=CF=D7=C1=D4=C5=CC=D8 Evgeny Panasyuk=20
=CE=C1=D0=C9=D3=C1=CC:
>
> No, I do not think so.
>>
>
> Why not?
> =20
>
>> It is common interface of all sequential containers including and=20
>> together with std::basic_string.
>>
>
> Just read GotW #84.
> std::string has many controversial design decisions. We should not uglify=
=20
> STL by borrowing bad stuff from std::string.
>
--=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_1833_23265141.1382443051263
Content-Type: text/html; charset=KOI8-R
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr"><div> </div><div>I do not see any great sense in this=
function. In fact you need to write its realization for each containe=
r. So it looks like the realization of function std:;swap in containers. Mo=
reover std::basic_string has already method append. So that to make th=
e call of the function interchangeable with other containers it is better t=
o make it a class member.</div><div>. <br>=D7=D4=CF=D2=CE=C9=CB, 22 =CF=CB=
=D4=D1=C2=D2=D1 2013 =C7., 3:20:59 UTC+4 =D0=CF=CC=D8=DA=CF=D7=C1=D4=
=C5=CC=D8 Evgeny Panasyuk =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-left-style: =
solid;"><div dir=3D"ltr"><br><blockquote class=3D"gmail_quote" style=3D"mar=
gin: 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>No, I do not think so.</div></div></blockquote><div><br>Why not?<br>&n=
bsp;</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-left-style: solid;"><div dir=3D"ltr"><div>It is common i=
nterface of all sequential containers including and together with=
std::basic_string.</div></div></blockquote><div><br>Just read GotW #84.<br=
>std::string has many controversial design decisions. We should not uglify =
STL by borrowing bad stuff from std::string.<br></div></div></blockquote></=
div>
<p></p>
-- <br />
<br />
--- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals" 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_1833_23265141.1382443051263--
.
Author: Vlad from Moscow <vlad.moscow@mail.ru>
Date: Tue, 22 Oct 2013 05:04:49 -0700 (PDT)
Raw View
------=_Part_4216_13823133.1382443489056
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
Taking into account method append of std::basic_string it is not a new=20
name. append and insert will have differenct semantic. append will return=
=20
reference to the container itself. So you can use it for example the=20
follwoing way
=20
std::vector<int> v =3D { 1, 2, 3, 4, 5 };
=20
for ( int x : v.append( { 4, 3, 2, 1 } ) ) std::cout << x << ' ';
=20
insert is used then you need the position after inserting new elements. For=
=20
example
=20
auto pos =3D v.end();
=20
pos =3D v.insert( pos, { 4, 3, 2, 1 } );
v.insert( pos, 5 );
=D0=B2=D1=82=D0=BE=D1=80=D0=BD=D0=B8=D0=BA, 22 =D0=BE=D0=BA=D1=82=D1=8F=D0=
=B1=D1=80=D1=8F 2013 =D0=B3., 11:56:50 UTC+4 =D0=BF=D0=BE=D0=BB=D1=8C=D0=B7=
=D0=BE=D0=B2=D0=B0=D1=82=D0=B5=D0=BB=D1=8C Bengt Gustafsson=20
=D0=BD=D0=B0=D0=BF=D0=B8=D1=81=D0=B0=D0=BB:
> I think the idea is good, this use case appears quite often. But why not=
=20
> overload push_back with more signatures instead of introducing a new name=
?=20
> The signatures available would then be exactly parallel to insert(), with=
=20
> the difference that the first parameter is absent.
>
>
> Den tisdagen den 22:e oktober 2013 kl. 01:20:59 UTC+2 skrev Evgeny=20
> Panasyuk:
>>
>>
>> No, I do not think so.
>>>
>>
>> Why not?
>> =20
>>
>>> It is common interface of all sequential containers including and=20
>>> together with std::basic_string.
>>>
>>
>> Just read GotW #84.
>> std::string has many controversial design decisions. We should not uglif=
y=20
>> STL by borrowing bad stuff from std::string.
>>
>
--=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_4216_13823133.1382443489056
Content-Type: text/html; charset=KOI8-R
Content-Transfer-Encoding: quoted-printable
<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> </div><div>std::vector<int> =
v =3D { 1, 2, 3, 4, 5 };</div><div> </div><div>for ( int x : v.ap=
pend( { 4, 3, 2, 1 } ) ) std::cout << x << ' ';</div><div> =
;</div><div>insert is used then you need the position after inserting new e=
lements. For example</div><div> </div><div>auto pos =3D v.end();</div>=
<div> </div><div>pos =3D v.insert( pos, { 4, 3, 2, 1 } );</div><div>v.=
insert( pos, 5 );</div><div><br>=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:</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-left-style: solid=
;"><div dir=3D"ltr">I think the idea is good, this use case appears quite o=
ften. But why not overload push_back with more signatures instead of introd=
ucing a new name? The signatures available would then be exactly parallel t=
o insert(), with the difference that the first parameter is absent.<div><br=
><br>Den tisdagen den 22:e oktober 2013 kl. 01:20:59 UTC+2 skrev Evgeny Pan=
asyuk:<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-widt=
h: 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; bor=
der-left-color: rgb(204, 204, 204); border-left-width: 1px; border-left-sty=
le: solid;"><div dir=3D"ltr"><div>No, I do not think so.</div></div></block=
quote><div><br>Why not?<br> </div><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 di=
r=3D"ltr"><div>It is common interface of all sequential containers inc=
luding and together with std::basic_string.</div></div></blockquote><d=
iv><br>Just read GotW #84.<br>std::string has many controversial design dec=
isions. We should not uglify STL by borrowing bad stuff from std::string.<b=
r></div></div></blockquote></div></div></blockquote></div>
<p></p>
-- <br />
<br />
--- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals" 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_4216_13823133.1382443489056--
.
Author: "Billy O'Neal" <billy.oneal@gmail.com>
Date: Tue, 22 Oct 2013 10:37:19 -0700
Raw View
--001a11c1ce68a1edda04e957dc00
Content-Type: text/plain; charset=KOI8-R
Content-Transfer-Encoding: quoted-printable
I suppose I understand why there's no append here -- append on basic_string
is the same thing effectively as operator+=3D -- but there's no such semant=
ic
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
Malware Response Instructor - BleepingComputer.com
On Tue, Oct 22, 2013 at 5:04 AM, Vlad from Moscow <vlad.moscow@mail.ru>wrot=
e:
> Taking into account method append of std::basic_string it is not a new
> name. append and insert will have differenct semantic. append will return
> reference to the container itself. So you can use it for example 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 introducing a new nam=
e?
>> The signatures available would then be exactly parallel to insert(), wit=
h
>> 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 and
>>>> together with std::basic_string.
>>>>
>>>
>>> Just read GotW #84.
>>> std::string has many controversial design decisions. We should not
>>> 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-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/.
--001a11c1ce68a1edda04e957dc00
Content-Type: text/html; charset=KOI8-R
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr">I suppose I understand why there's no append here -- a=
ppend on basic_string is the same thing effectively as operator+=3D -- but =
there's no such semantic operation that makes sense for vector.<div><br=
>
</div><div>I suppose there's no reason for someone who wants this seman=
tic not to do:</div><div><br></div><div>template <typename T, typename I=
nputIterator></div><div>T& append(T& container, InputIterator fi=
rst, InputIterator last)</div>
<div>{</div><div>=9A =9A container.insert(container.end(), first, last);</d=
iv><div>=9A =9A return container;</div><div>}</div><div><div class=3D"gmail=
_extra"><br clear=3D"all"><div><div dir=3D"ltr"><div>Billy O'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/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 5:04 AM, Vlad fr=
om Moscow <span dir=3D"ltr"><<a href=3D"mailto:vlad.moscow@mail.ru" targ=
et=3D"_blank">vlad.moscow@mail.ru</a>></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>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<int> 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 <=
< x << ' ';</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><d=
iv>
<p></p>
-- <br>
=9A<br>
--- <br>
You received this message because you are subscribed to the Google Groups &=
quot;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"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></div></div>
<p></p>
-- <br />
<br />
--- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals" 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 />
--001a11c1ce68a1edda04e957dc00--
.
Author: Evgeny Panasyuk <evgeny.panasyuk@gmail.com>
Date: Tue, 22 Oct 2013 10:38:05 -0700 (PDT)
Raw View
------=_Part_173_15981486.1382463485532
Content-Type: text/plain; charset=ISO-8859-1
>
>
> 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 realization
> 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 containers, 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
--
---
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/.
------=_Part_173_15981486.1382463485532
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr"><blockquote class=3D"gmail_quote" style=3D"margin: 0;margi=
n-left: 0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;"><div dir=3D"l=
tr"><div> </div><div>I do not see any great sense in this function. In=
fact you need to write its realization for each container. So it look=
s like the realization of function std:;swap in containers. Moreover std::b=
asic_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 c=
lass member.</div></div></blockquote><div> <br>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).<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, but also about containers which users de=
veloped themself since 1998.<br>Just look at http://www.boost.org/doc/libs/=
1_54_0/libs/range/doc/html/range/reference/algorithms/new/push_back.html<br=
><br></div></div>
<p></p>
-- <br />
<br />
--- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals" 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_173_15981486.1382463485532--
.
Author: Vlad from Moscow <vlad.moscow@mail.ru>
Date: Tue, 22 Oct 2013 13:03:53 -0700 (PDT)
Raw View
------=_Part_434_27953027.1382472233301
Content-Type: text/plain; charset=KOI8-R
Content-Transfer-Encoding: quoted-printable
=20
In this case you can not substituted a call of the method for=20
std::basic_string with a call for a vector. So the interface will not be=20
consistent.=20
=20
Apart from this the call
=20
std::cout << v.append( { 1, 2, 3, 4, 5 } );
=20
looks semantically more clear than
=20
std::cout << append( v, { 1, 2, 3, 4, 5 } );
=20
From the second call it is not clear what is outputed whether it is a new=
=20
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 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:
> I suppose I understand why there's no append here -- append on=20
> basic_string is the same thing effectively as operator+=3D -- but there's=
no=20
> 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
> Malware Response Instructor - BleepingComputer.com
>
>
> On Tue, Oct 22, 2013 at 5:04 AM, Vlad from Moscow <vlad....@mail.ru<javas=
cript:>
> > wrote:
>
>> Taking into account method append of std::basic_string it is not a new=
=20
>> name. append and insert will have differenct semantic. append will retur=
n=20
>> reference to the container itself. So you can use it for example the=20
>> follwoing way
>> =20
>> std::vector<int> v =3D { 1, 2, 3, 4, 5 };
>> =20
>> for ( int x : v.append( { 4, 3, 2, 1 } ) ) std::cout << x << ' ';
>> =20
>> insert is used then you need the position after inserting new elements.=
=20
>> For example
>> =20
>> auto pos =3D v.end();
>> =20
>> 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=20
>> =CE=C1=D0=C9=D3=C1=CC:
>>
>>> I think the idea is good, this use case appears quite often. But why no=
t=20
>>> overload push_back with more signatures instead of introducing a new na=
me?=20
>>> The signatures available would then be exactly parallel to insert(), wi=
th=20
>>> the difference that the first parameter is absent.
>>>
>>>
>>> Den tisdagen den 22:e oktober 2013 kl. 01:20:59 UTC+2 skrev Evgeny=20
>>> Panasyuk:
>>>>
>>>>
>>>> No, I do not think so.
>>>>>
>>>>
>>>> Why not?
>>>> =20
>>>>
>>>>> It is common interface of all sequential containers including and=20
>>>>> together with std::basic_string.
>>>>>
>>>>
>>>> Just read GotW #84.
>>>> std::string has many controversial design decisions. We should not=20
>>>> uglify STL by borrowing bad stuff from std::string.
>>>>
>>> --=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_434_27953027.1382472233301
Content-Type: text/html; charset=KOI8-R
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr"><div> </div><div>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. </div><div> </div><div>Apart =
from this the call</div><div> </div><div>std::cout << v.append( =
{ 1, 2, 3, 4, 5 } );</div><div> </div><div>looks semantically more cle=
ar than</div><div> </div><div>std::cout << append( v, { 1, 2, 3,=
4, 5 } );</div><div> </div><div>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 =C7.=
, 21:37:19 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><blockquote class=3D"gmail_quote" style=3D"margin: 0p=
x 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">I suppo=
se I understand why there's no append here -- append on basic_string is the=
same thing effectively as operator+=3D -- but there's no such semantic ope=
ration that makes sense for vector.<div><br>
</div><div>I suppose there's no reason for someone who wants this semantic =
not to do:</div><div><br></div><div>template <typename T, typename Input=
Iterator></div><div>T& append(T& container, InputIterator first,=
InputIterator last)</div>
<div>{</div><div> container.insert(container.<wbr>end(), first=
, last);</div><div> return container;</div><div>}</div><div><d=
iv><br clear=3D"all"><div><div dir=3D"ltr"><div>Billy O'Neal</div><div><a h=
ref=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/<wbr>users/82320/billy-oneal</a></div><div>Mal=
ware Response Instructor - BleepingComputer.com</div></div></div>
<br><br><div class=3D"gmail_quote">On Tue, Oct 22, 2013 at 5:04 AM, Vlad fr=
om Moscow <span dir=3D"ltr"><<a href=3D"javascript:" target=3D"_blank" g=
df-obfuscated-mailto=3D"nS9EIkvork8J">vlad....@mail.ru</a>></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>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> </div><div>std::vector<int> v =3D { 1, 2, 3, 4, 5 };</div>=
<div> </div><div>for ( int x : v.append( { 4, 3, 2, 1 } ) ) std::=
cout << x << ' ';</div><div> </div><div>insert is used the=
n you need the position after inserting new elements. For example</div>
<div> </div><div>auto pos =3D v.end();</div><div> </div><div>pos =
=3D v.insert( pos, { 4, 3, 2, 1 } );</div><div>v.insert( pos, 5 );</di=
v><div><br>=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:</div>
<div><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-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 wi=
th more signatures instead of introducing a new name? The signatures availa=
ble would then be exactly parallel to insert(), with the difference that th=
e first parameter 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.8=
ex; padding-left: 1ex; border-left-color: rgb(204, 204, 204); border-left-w=
idth: 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); b=
order-left-width: 1px; border-left-style: solid;"><div dir=3D"ltr"><div>No,=
I do not think so.</div>
</div></blockquote><div><br>Why not?<br> </div><blockquote class=3D"gm=
ail_quote" style=3D"margin: 0px 0px 0px 0.8ex; padding-left: 1ex; border-le=
ft-color: rgb(204, 204, 204); border-left-width: 1px; border-left-style: so=
lid;"><div dir=3D"ltr">
<div>It is common interface of all sequential containers including&nbs=
p;and together with std::basic_string.</div></div></blockquote><div><br>Jus=
t read GotW #84.<br>std::string has many controversial design decisions. We=
should not uglify STL by borrowing bad stuff from std::string.<br>
</div></div></blockquote></div></div></blockquote></div></div></div><div><d=
iv>
<p></p>
-- <br>
<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"=
nS9EIkvork8J">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"nS9EIkvork8J">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>
</div></div></blockquote></div><br></div></div></div>
</blockquote></div>
<p></p>
-- <br />
<br />
--- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals" 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_434_27953027.1382472233301--
.
Author: "Billy O'Neal" <billy.oneal@gmail.com>
Date: Tue, 22 Oct 2013 13:09:59 -0700
Raw View
--089e0149ce369605a804e959fe68
Content-Type: text/plain; charset=KOI8-R
Content-Transfer-Encoding: quoted-printable
>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 about the
syntactical difference between member and nommember functions which 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
Malware Response Instructor - BleepingComputer.com
On Tue, Oct 22, 2013 at 1:03 PM, Vlad from Moscow <vlad.moscow@mail.ru>wrot=
e:
>
> 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 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 suppose I understand why there's no append here -- append on
>> basic_string is the same thing effectively as operator+=3D -- but there'=
s no
>> such semantic operation that makes sense for vector.
>>
>> I suppose there's no reason for someone who wants this semantic not to d=
o:
>>
>> 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://stackoverflow=
..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>wrot=
e:
>>
>>> Taking into account method append of std::basic_string it is not a new
>>> name. append and insert will have differenct semantic. append will retu=
rn
>>> reference to the container itself. So you can use it for example 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 introducing a n=
ew
>>>> name? The signatures available would then be exactly parallel to inser=
t(),
>>>> 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 and
>>>>>> together with std::basic_string.
>>>>>>
>>>>>
>>>>> Just read GotW #84.
>>>>> std::string has many controversial design decisions. We should not
>>>>> 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/**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/.
--089e0149ce369605a804e959fe68
Content-Type: text/html; charset=KOI8-R
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr"><div>>From the second call it is not clear what is outp=
uted whether it is a new vector or it is the original vector.</div><div><br=
></div><div>I disagree. You can use nonmember append with basic_string, and=
the name "append" implies modifying the original vector. There&#=
39;s nothing about the syntactical difference between member and nommember =
functions which clearly indicates "this modifies" or "this d=
oes not modify".</div>
<div><br></div><div>That is, there's no reason "v.append(xyz)"=
; doesn't return a different vector either, by this logic.</div></div><=
div class=3D"gmail_extra"><br clear=3D"all"><div><div dir=3D"ltr"><div>Bill=
y O'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"_blank">http://stackoverflow.com/users/8=
2320/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:03 PM, Vlad fr=
om Moscow <span dir=3D"ltr"><<a href=3D"mailto:vlad.moscow@mail.ru" targ=
et=3D"_blank">vlad.moscow@mail.ru</a>></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>=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 << 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 << 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'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 class=3D"im">I suppose I understand why there's n=
o append here -- append on basic_string is the same thing effectively as op=
erator+=3D -- but there's no such semantic operation that makes sense f=
or vector.<div>
<br>
</div><div>I suppose there's no reason for someone who wants this seman=
tic not to do:</div><div><br></div><div>template <typename T, typename I=
nputIterator></div><div>T& append(T& container, InputIterator fi=
rst, InputIterator last)</div>
<div>{</div><div>=9A =9A container.insert(container.<u></u>end(), first, la=
st);</div><div>=9A =9A return container;</div><div>}</div></div><div><div><=
div class=3D"im"><br clear=3D"all"><div><div dir=3D"ltr"><div>Billy O'N=
eal</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/82320/billy-oneal</a></div><div>M=
alware Response Instructor - BleepingComputer.com</div></div></div>
<br><br></div><div class=3D"gmail_quote"><div class=3D"im">On Tue, Oct 22, =
2013 at 5:04 AM, Vlad from Moscow <span dir=3D"ltr"><<a>vlad....@mail.ru=
</a>></span> wrote:<br></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-left-style:solid">
<div class=3D"im">
<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<int> 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 <=
< x << ' ';</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 class=3D"im">
<p></p>
-- <br>
=9A<br>
--- <br>
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals" 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 class=
=3D"im"><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></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" 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 />
<br />
--- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals" 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 />
--089e0149ce369605a804e959fe68--
.
Author: Vlad from Moscow <vlad.moscow@mail.ru>
Date: Tue, 22 Oct 2013 13:11:02 -0700 (PDT)
Raw View
------=_Part_3616_32334626.1382472662144
Content-Type: text/plain; charset=KOI8-R
Content-Transfer-Encoding: quoted-printable
As I said I do not see a great sense to make the method as a non-member=20
function. In my opinion it is a wrong approach because if to do so the=20
question arises what to do with arrays. They have no method insert. Also=20
what to do with other containers that also have no method insert as for=20
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=20
=CE=C1=D0=C9=D3=C1=CC:
> =20
>> I do not see any great sense in this function. In fact you need to=20
>> write its realization for each container. So it looks like the realizati=
on=20
>> of function std:;swap in containers. Moreover std::basic_string has=20
>> already method append. So that to make the call of the function=20
>> interchangeable with other containers it is better to make it a class=20
>> member.
>>
> =20
> Non-member append/push_back is easily implementable in terms of end()=20
> (which is part of Container concept requirnment since 1998) and insert(..=
..)=20
> (which is part of Sequence concept requirenment since 1998).
> Once such function will be implemented as non-member it would work with=
=20
> any conformant sequence automaticly. That is not only about STL container=
s,=20
> but also about containers which users developed themself since 1998.
> Just look at=20
> http://www.boost.org/doc/libs/1_54_0/libs/range/doc/html/range/reference/=
algorithms/new/push_back.html
>
>
--=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_3616_32334626.1382472662144
Content-Type: text/html; charset=KOI8-R
Content-Transfer-Encoding: quoted-printable
<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, 2=
2 =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:</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-lef=
t-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(20=
4, 204, 204); border-left-width: 1px; border-left-style: solid;"><div dir=
=3D"ltr"><div> </div><div>I do not see any great sense in this functio=
n. In fact you need to write its realization for each container. So it=
looks like the realization of function std:;swap in containers. Moreover s=
td::basic_string has already method append. So that to make the call o=
f the function interchangeable with other containers it is better to make i=
t a class member.</div></div></blockquote><div> <br>Non-member append/=
push_back is easily implementable in terms of end() (which is part of Conta=
iner concept requirnment since 1998) and insert(...) (which is part of Sequ=
ence concept requirenment since 1998).<br>Once such function will be implem=
ented as non-member it would work with any conformant sequence automaticly.=
That is not only about STL containers, but also about containers which use=
rs developed themself since 1998.<br>Just look at <a href=3D"http://www.boo=
st.org/doc/libs/1_54_0/libs/range/doc/html/range/reference/algorithms/new/p=
ush_back.html" target=3D"_blank">http://www.boost.org/doc/libs/<wbr>1_54_0/=
libs/range/doc/html/<wbr>range/reference/algorithms/<wbr>new/push_back.html=
</a><br><br></div></div></blockquote></div>
<p></p>
-- <br />
<br />
--- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals" 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_3616_32334626.1382472662144--
.
Author: "Billy O'Neal" <billy.oneal@gmail.com>
Date: Tue, 22 Oct 2013 13:13:40 -0700
Raw View
--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>> 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>>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'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"><<a href=3D"mailto:vlad.moscow@mail.ru" targ=
et=3D"_blank">vlad.moscow@mail.ru</a>></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" 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 />
<br />
--- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals" 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--
.
Author: Evgeny Panasyuk <evgeny.panasyuk@gmail.com>
Date: Tue, 22 Oct 2013 13:15:08 -0700 (PDT)
Raw View
------=_Part_3692_2782571.1382472909076
Content-Type: text/plain; charset=ISO-8859-1
>
> 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.
>
What? Do you want to turn std::vector into std::string-like bloat?
Apart from this the call
>
> std::cout << v.append( { 1, 2, 3, 4, 5 } );
>
> looks semantically more clear than
>
No, it is common practice to prefer non-member functions over members. It
increases generality, encapsulation, etc.
Just read works of Stepanov, Stroustrup, Alexandrescu, Mayers, Sutter.
>
> 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.
>
I don't see anything special in member-version that makes it semanticaly
cleaner.
--
---
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/.
------=_Part_3692_2782571.1382472909076
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr"> <blockquote class=3D"gmail_quote" style=3D"margin: 0=
;margin-left: 0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;"><div di=
r=3D"ltr"><div>In this case you can not substituted a call of the method fo=
r std::basic_string with a call for a vector. So the interface will no=
t be consistent.</div></div></blockquote><div><br>What? Do you want to turn=
std::vector into std::string-like bloat?<br><br></div><blockquote class=3D=
"gmail_quote" style=3D"margin: 0;margin-left: 0.8ex;border-left: 1px #ccc s=
olid;padding-left: 1ex;"><div dir=3D"ltr"><div>Apart from this the call</di=
v><div> </div><div>std::cout << v.append( { 1, 2, 3, 4, 5 } );</=
div><div> </div><div>looks semantically more clear than</div></div></b=
lockquote><div><br>No, it is common practice to prefer non-member functions=
over members. It increases generality, encapsulation, etc.<br>Just read wo=
rks of Stepanov, Stroustrup, Alexandrescu, Mayers, Sutter.<br> </div><=
blockquote class=3D"gmail_quote" style=3D"margin: 0;margin-left: 0.8ex;bord=
er-left: 1px #ccc solid;padding-left: 1ex;"><div dir=3D"ltr"><div> </d=
iv><div>std::cout << append( v, { 1, 2, 3, 4, 5 } );</div><div> =
</div><div>From the second call it is not clear what is outputed whether it=
is a new vector or it is the original vector.<br></div></div></blockquote>=
<div><br>I don't see anything special in member-version that makes it seman=
ticaly cleaner.<br><br><br></div></div>
<p></p>
-- <br />
<br />
--- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals" 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_3692_2782571.1382472909076--
.
Author: Vlad from Moscow <vlad.moscow@mail.ru>
Date: Tue, 22 Oct 2013 13:17:46 -0700 (PDT)
Raw View
------=_Part_555_25729524.1382473066924
Content-Type: text/plain; charset=KOI8-R
Content-Transfer-Encoding: quoted-printable
If v.append( /*...*/ ) indeed will not return the vector itself then I=20
could agree with you that a non-member function can be introduced. But in=
=20
my opinion only this call
=20
append( v, { 1, 2, 3, 4 } )
=20
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 ne=
w=20
> vector or it is the original vector.
>
> I disagree. You can use nonmember append with basic_string, and the name=
=20
> "append" implies modifying the original vector. There's nothing about the=
=20
> syntactical difference between member and nommember functions which clear=
ly=20
> indicates "this modifies" or "this does not modify".
>
> That is, there's no reason "v.append(xyz)" doesn't return a different=20
> vector either, by this logic.
>
> 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:03 PM, Vlad from Moscow <vlad....@mail.ru<javas=
cript:>
> > wrote:
>
>> =20
>> In this case you can not substituted a call of the method for=20
>> std::basic_string with a call for a vector. So the interface will not be=
=20
>> consistent.=20
>> =20
>> Apart from this the call
>> =20
>> std::cout << v.append( { 1, 2, 3, 4, 5 } );
>> =20
>> looks semantically more clear than
>> =20
>> std::cout << append( v, { 1, 2, 3, 4, 5 } );
>> =20
>> From the second call it is not clear what is outputed whether it is a ne=
w=20
>> 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 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:
>>
>>> I suppose I understand why there's no append here -- append on=20
>>> basic_string is the same thing effectively as operator+=3D -- but there=
's no=20
>>> such semantic operation that makes sense for vector.
>>>
>>> I suppose there's no reason for someone who wants this semantic not to=
=20
>>> 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://stackoverflo=
w.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>wro=
te:
>>>
>>>> Taking into account method append of std::basic_string it is not a=20
>>>> new name. append and insert will have differenct semantic. append will=
=20
>>>> return reference to the container itself. So you can use it for exampl=
e the=20
>>>> follwoing way
>>>> =20
>>>> std::vector<int> v =3D { 1, 2, 3, 4, 5 };
>>>> =20
>>>> for ( int x : v.append( { 4, 3, 2, 1 } ) ) std::cout << x << ' ';
>>>> =20
>>>> insert is used then you need the position after inserting new elements=
..=20
>>>> For example
>>>> =20
>>>> auto pos =3D v.end();
>>>> =20
>>>> 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 UT=
C+4 =D0=CF=CC=D8=DA=CF=D7=C1=D4=C5=CC=D8 Bengt=20
>>>> Gustafsson =CE=C1=D0=C9=D3=C1=CC:
>>>>
>>>>> I think the idea is good, this use case appears quite often. But why=
=20
>>>>> not overload push_back with more signatures instead of introducing a =
new=20
>>>>> name? The signatures available would then be exactly parallel to inse=
rt(),=20
>>>>> with the difference that the first parameter is absent.
>>>>>
>>>>>
>>>>> Den tisdagen den 22:e oktober 2013 kl. 01:20:59 UTC+2 skrev Evgeny=20
>>>>> Panasyuk:
>>>>>>
>>>>>>
>>>>>> No, I do not think so.
>>>>>>>
>>>>>>
>>>>>> Why not?
>>>>>> =20
>>>>>>
>>>>>>> It is common interface of all sequential containers including and=
=20
>>>>>>> together with std::basic_string.
>>>>>>>
>>>>>>
>>>>>> Just read GotW #84.
>>>>>> std::string has many controversial design decisions. We should not=
=20
>>>>>> uglify STL by borrowing bad stuff from std::string.
>>>>>>
>>>>> --=20
>>>> =20
>>>> ---=20
>>>> You received this message because you are subscribed to the Google=20
>>>> Groups "ISO C++ Standard - Future Proposals" group.
>>>> To unsubscribe from this group and stop receiving emails from it, send=
=20
>>>> 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/=
>
>>>> .
>>>>
>>>
>>> --=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_555_25729524.1382473066924
Content-Type: text/html; charset=KOI8-R
Content-Transfer-Encoding: quoted-printable
<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> </div><div>appen=
d( v, { 1, 2, 3, 4 } )</div><div> </div><div>can arise a question what=
is actually returned.</div><div><br>=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 Bill=
y O'Neal =CE=C1=D0=C9=D3=C1=CC:</div><blockquote class=3D"gmail_quote" styl=
e=3D"margin: 0px 0px 0px 0.8ex; padding-left: 1ex; border-left-color: rgb(2=
04, 204, 204); border-left-width: 1px; border-left-style: solid;"><div dir=
=3D"ltr"><div>>From the second call it is not clear what is outputed whe=
ther it is a new vector or it is the original vector.</div><div><br></div><=
div>I disagree. You can use nonmember append with basic_string, and the nam=
e "append" implies modifying the original vector. There's nothing about the=
syntactical difference between member and nommember functions which clearl=
y indicates "this modifies" or "this does not modify".</div>
<div><br></div><div>That is, there's no reason "v.append(xyz)" doesn't retu=
rn a different vector either, by this logic.</div></div><div><br clear=3D"a=
ll"><div><div dir=3D"ltr"><div>Billy O'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"_blank">http://stackoverflow.com/<wbr>us=
ers/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:03 PM, Vlad fr=
om Moscow <span dir=3D"ltr"><<a href=3D"javascript:" target=3D"_blank" g=
df-obfuscated-mailto=3D"h037rq5A1z8J">vlad....@mail.ru</a>></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> </div><div>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. </div><div> </div><div>Apart =
from this the call</div>
<div> </div><div>std::cout << v.append( { 1, 2, 3, 4, 5 } );</di=
v><div> </div><div>looks semantically more clear than</div><div> =
</div><div>std::cout << append( v, { 1, 2, 3, 4, 5 } );</div><div>&nb=
sp;</div><div>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 =C7., 21=
:37:19 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><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>I suppose I understand why there's no append here -- =
append on basic_string is the same thing effectively as operator+=3D -- but=
there's no such semantic operation that makes sense for vector.<div>
<br>
</div><div>I suppose there's no reason for someone who wants this semantic =
not to do:</div><div><br></div><div>template <typename T, typename Input=
Iterator></div><div>T& append(T& container, InputIterator first,=
InputIterator last)</div>
<div>{</div><div> container.insert(container.<u></u>end<wbr>()=
, first, last);</div><div> return container;</div><div>}</div>=
</div><div><div><div><br clear=3D"all"><div><div dir=3D"ltr"><div>Billy O'N=
eal</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<wbr>/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"><<a>vlad....@mail.ru</a>></spa=
n> wrote:<br></div><blockquote class=3D"gmail_quote" style=3D"margin: 0px 0=
px 0px 0.8ex; padding-left: 1ex; border-left-color: rgb(204, 204, 204); bor=
der-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> </div><div>std::vector<int> v =3D { 1, 2, 3, 4, 5 };</div>=
<div> </div><div>for ( int x : v.append( { 4, 3, 2, 1 } ) ) std::=
cout << x << ' ';</div><div> </div><div>insert is used the=
n you need the position after inserting new elements. For example</div>
<div> </div><div>auto pos =3D v.end();</div><div> </div><div>pos =
=3D v.insert( pos, { 4, 3, 2, 1 } );</div><div>v.insert( pos, 5 );</di=
v><div><br>=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:</div>
<div><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-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 wi=
th more signatures instead of introducing a new name? The signatures availa=
ble would then be exactly parallel to insert(), with the difference that th=
e first parameter 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.8=
ex; padding-left: 1ex; border-left-color: rgb(204, 204, 204); border-left-w=
idth: 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); b=
order-left-width: 1px; border-left-style: solid;"><div dir=3D"ltr"><div>No,=
I do not think so.</div>
</div></blockquote><div><br>Why not?<br> </div><blockquote class=3D"gm=
ail_quote" style=3D"margin: 0px 0px 0px 0.8ex; padding-left: 1ex; border-le=
ft-color: rgb(204, 204, 204); border-left-width: 1px; border-left-style: so=
lid;"><div dir=3D"ltr">
<div>It is common interface of all sequential containers including&nbs=
p;and together with std::basic_string.</div></div></blockquote><div><br>Jus=
t read GotW #84.<br>std::string has many controversial design decisions. We=
should 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>
<br>
--- <br>
You received this message because you are subscribed to the Google Groups "=
ISO C++ Standard - Future Proposals" 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<wbr=
>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>
<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"=
h037rq5A1z8J">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"h037rq5A1z8J">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>
</div></div></blockquote></div><br></div>
</blockquote></div>
<p></p>
-- <br />
<br />
--- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals" 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_555_25729524.1382473066924--
.
Author: "Billy O'Neal" <billy.oneal@gmail.com>
Date: Tue, 22 Oct 2013 13:18:42 -0700
Raw View
--089e0117686bc5d4c904e95a1d4c
Content-Type: text/plain; charset=KOI8-R
Content-Transfer-Encoding: quoted-printable
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
Malware Response Instructor - BleepingComputer.com
On Tue, Oct 22, 2013 at 1:17 PM, Vlad from Moscow <vlad.moscow@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 about th=
e
>> syntactical difference between member and nommember functions which clea=
rly
>> 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://stackoverflow.=
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>wrot=
e:
>>
>>>
>>> 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 b=
e
>>> 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 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 suppose I understand why there's no append here -- append on
>>>> basic_string is the same thing effectively as operator+=3D -- but ther=
e'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://stackover=
flow.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>wr=
ote:
>>>>
>>>>> Taking into account method append of std::basic_string it is not a
>>>>> new name. append and insert will have differenct semantic. append wil=
l
>>>>> return reference to the container itself. So you can use it for examp=
le 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 U=
TC+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 introducing a=
new
>>>>>> name? The signatures available would then be exactly parallel to ins=
ert(),
>>>>>> 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 and
>>>>>>>> together with std::basic_string.
>>>>>>>>
>>>>>>>
>>>>>>> Just read GotW #84.
>>>>>>> std::string has many controversial design decisions. We should not
>>>>>>> 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, 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/.
--089e0117686bc5d4c904e95a1d4c
Content-Type: text/html; charset=KOI8-R
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr"><div>I don't see why </div><div>append( v, { 1, 2, 3, =
4 } )</div><div>raises any more question about what is actually returned wh=
en compared with</div><div>v.append( { 1, 2, 3, 4 } )</div></div><div class=
=3D"gmail_extra">
<br clear=3D"all"><div><div dir=3D"ltr"><div>Billy O'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:17 PM, Vlad fr=
om Moscow <span dir=3D"ltr"><<a href=3D"mailto:vlad.moscow@mail.ru" targ=
et=3D"_blank">vlad.moscow@mail.ru</a>></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>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'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 class=3D"im"><div dir=3D"ltr"><div>>From the second call it is not =
clear what is outputed whether it is a new vector or it is the original vec=
tor.</div><div><br></div><div>I disagree. You can use nonmember append with=
basic_string, and the name "append" implies modifying the origin=
al vector. There's nothing about the syntactical difference between mem=
ber and nommember functions which clearly indicates "this modifies&quo=
t; or "this does not modify".</div>
<div><br></div><div>That is, there's no reason "v.append(xyz)"=
; doesn't return a different vector either, by this logic.</div></div><=
/div><div><div class=3D"im"><br clear=3D"all"><div><div dir=3D"ltr"><div>Bi=
lly O'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"_blank">http://stackoverflow.com/<u></u>=
users/82320/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:03 PM, Vlad from Moscow <span dir=3D"ltr"><<a>vlad....@ma=
il.ru</a>></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>=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 << 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 << 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'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's no append here=
-- append on basic_string is the same thing effectively as operator+=3D --=
but there's no such semantic operation that makes sense for vector.<di=
v>
<br>
</div><div>I suppose there's no reason for someone who wants this seman=
tic not to do:</div><div><br></div><div>template <typename T, typename I=
nputIterator></div><div>T& append(T& container, InputIterator fi=
rst, InputIterator last)</div>
<div>{</div><div>=9A =9A container.insert(container.<u></u>end<u></u>(), fi=
rst, last);</div><div>=9A =9A return container;</div><div>}</div></div><div=
><div><div><br clear=3D"all"><div><div dir=3D"ltr"><div>Billy O'Neal</d=
iv>
<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>/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"><<a>vlad....@mail.ru</a>></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<int> 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 <=
< x << ' ';</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" 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>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" 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" 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 />
<br />
--- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals" 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 />
--089e0117686bc5d4c904e95a1d4c--
.
Author: Vlad from Moscow <vlad.moscow@mail.ru>
Date: Tue, 22 Oct 2013 13:24:12 -0700 (PDT)
Raw View
------=_Part_304_3475830.1382473452456
Content-Type: text/plain; charset=KOI8-R
Content-Transfer-Encoding: quoted-printable
In my opinion append is a property of a container. Arrays have no such a=20
property, std::array also has no such a property. Associative containers=20
also have no such a property. std::forward_list has no method insert. So a=
=20
general function will only conduse users.
=20
And your "general practice" is not applied in this case because as I said=
=20
it is a property of a container.
=20
=D3=D2=C5=C4=C1, 23 =CF=CB=D4=D1=C2=D2=D1 2013 =C7., 0:15:08 UTC+4 =D0=CF=
=CC=D8=DA=CF=D7=C1=D4=C5=CC=D8 Evgeny Panasyuk=20
=CE=C1=D0=C9=D3=C1=CC:
> =20
>>
>> In this case you can not substituted a call of the method for=20
>> std::basic_string with a call for a vector. So the interface will not be=
=20
>> consistent.
>>
>
> What? Do you want to turn std::vector into std::string-like bloat?
>
> Apart from this the call
>> =20
>> std::cout << v.append( { 1, 2, 3, 4, 5 } );
>> =20
>> looks semantically more clear than
>>
>
> No, it is common practice to prefer non-member functions over members. It=
=20
> increases generality, encapsulation, etc.
> Just read works of Stepanov, Stroustrup, Alexandrescu, Mayers, Sutter.
> =20
>
>> =20
>> std::cout << append( v, { 1, 2, 3, 4, 5 } );
>> =20
>> From the second call it is not clear what is outputed whether it is a ne=
w=20
>> vector or it is the original vector.
>>
>
> I don't see anything special in member-version that makes it semanticaly=
=20
> cleaner.
>
>
>
--=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_304_3475830.1382473452456
Content-Type: text/html; charset=KOI8-R
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr"><div>In my opinion append is a property of a container. Ar=
rays have no such a property, std::array also has no such a property. Assoc=
iative containers also have no such a property. std::forward_list has no me=
thod insert. So a general function will only conduse users.</div><div> =
;</div><div>And your "general practice" is not applied in this case because=
as I said it is a property of a container.</div><div> </div><div><br>=
=D3=D2=C5=C4=C1, 23 =CF=CB=D4=D1=C2=D2=D1 2013 =C7., 0:15:08 UTC+4 =D0=
=CF=CC=D8=DA=CF=D7=C1=D4=C5=CC=D8 Evgeny Panasyuk =CE=C1=D0=C9=D3=C1=CC:</d=
iv><blockquote class=3D"gmail_quote" style=3D"margin: 0px 0px 0px 0.8ex; pa=
dding-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-width: 1px; border-left-style:=
solid;"><div dir=3D"ltr"><div>In this case you can not substituted a call =
of the method for std::basic_string with a call for a vector. So the i=
nterface will not be consistent.</div></div></blockquote><div><br>What? Do =
you want to turn std::vector into std::string-like bloat?<br><br></div><blo=
ckquote class=3D"gmail_quote" style=3D"margin: 0px 0px 0px 0.8ex; padding-l=
eft: 1ex; border-left-color: rgb(204, 204, 204); border-left-width: 1px; bo=
rder-left-style: solid;"><div dir=3D"ltr"><div>Apart from this the call</di=
v><div> </div><div>std::cout << v.append( { 1, 2, 3, 4, 5 } );</=
div><div> </div><div>looks semantically more clear than</div></div></b=
lockquote><div><br>No, it is common practice to prefer non-member functions=
over members. It increases generality, encapsulation, etc.<br>Just read wo=
rks of Stepanov, Stroustrup, Alexandrescu, Mayers, Sutter.<br> </div><=
blockquote class=3D"gmail_quote" style=3D"margin: 0px 0px 0px 0.8ex; paddin=
g-left: 1ex; border-left-color: rgb(204, 204, 204); border-left-width: 1px;=
border-left-style: solid;"><div dir=3D"ltr"><div> </div><div>std::cou=
t << append( v, { 1, 2, 3, 4, 5 } );</div><div> </div><div>From =
the second call it is not clear what is outputed whether it is a new vector=
or it is the original vector.<br></div></div></blockquote><div><br>I don't=
see anything special in member-version that makes it semanticaly cleaner.<=
br><br><br></div></div></blockquote></div>
<p></p>
-- <br />
<br />
--- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals" 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_304_3475830.1382473452456--
.
Author: Evgeny Panasyuk <evgeny.panasyuk@gmail.com>
Date: Tue, 22 Oct 2013 13:26:27 -0700 (PDT)
Raw View
------=_Part_3647_2373049.1382473587887
Content-Type: text/plain; charset=ISO-8859-1
>
> 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.
>
It will just fail to compile, just as it should.
They have no method insert. Also what to do with other containers that also
> have no method insert as for example std::forward_list?
>
There are ways to implement special versions for std::forward_list, like
overloading.
But at first, which semantic you want to have for append( fwd_list, ... ) ?
std::forward_list does not even have push_back - I think it should just
fail on append.
--
---
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/.
------=_Part_3647_2373049.1382473587887
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr"><blockquote class=3D"gmail_quote" style=3D"margin: 0;margi=
n-left: 0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;"><div dir=3D"l=
tr"><div>As I said I do not see a great sense to make the method as a non-m=
ember function. In my opinion it is a wrong approach because if to do so th=
e question arises what to do with arrays.</div></div></blockquote><div><br>=
It will just fail to compile, just as it should.<br><br></div><blockquote c=
lass=3D"gmail_quote" style=3D"margin: 0;margin-left: 0.8ex;border-left: 1px=
#ccc solid;padding-left: 1ex;"><div dir=3D"ltr"><div>They have no method i=
nsert. Also what to do with other containers that also have no method inser=
t as for example std::forward_list?</div></div></blockquote><div><br>There =
are ways to implement special versions for std::forward_list, like overload=
ing.<br>But at first, which semantic you want to have for append( fwd_list,=
... ) ? std::forward_list does not even have push_back - I think it should=
just fail on append.<br></div></div>
<p></p>
-- <br />
<br />
--- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals" 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_3647_2373049.1382473587887--
.
Author: Joel Falcou <joel.falcou@gmail.com>
Date: Tue, 22 Oct 2013 22:24:12 +0200
Raw View
On 22/10/2013 22:24, Vlad from Moscow wrote:
> In my opinion append is a property of a container. Arrays have no such
> a property, std::array also has no such a property. Associative
> containers also have no such a property. std::forward_list has no
> method insert. So a general function will only conduse users.
> And your "general practice" is not applied in this case because as I
> said it is a property of a container.
>
- append on std array can just return a new array with a larger size and
new elements.
- the fact append doesn't work on associative container an just be
implented with either concept overloading on the container properties
(when concept are in) or fallback to a static_assert.
- std::forward_list can also reconstruct a new, larger list with
appended data
i don't see why it hsould be limited really
--
---
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/.
.
Author: "Billy O'Neal" <billy.oneal@gmail.com>
Date: Tue, 22 Oct 2013 13:30:14 -0700
Raw View
--089e0160c66003697d04e95a4746
Content-Type: text/plain; charset=ISO-8859-1
>append on std array can just return a new array with a larger size and new
elements.
It could, but that's sufficiently different from what append does in other
cases, it shouldn't do that. The word for this would be "concat", which
would be just fine for std::array (as well as other containers).
And actually, I'm not sure it could in all cases -- e.g. if the begin / end
iterator pair size is not known at compile time.
>std::forward_list can also reconstruct a new, larger list with appended
data
Same comment as before. That would not be an append, it would be a concat.
If there should be nonmember concat that's one thing, but what you describe
is not an append. The word "append" implies that the original sequence was
modified.
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:24 PM, Joel Falcou <joel.falcou@gmail.com> wrote:
> On 22/10/2013 22:24, Vlad from Moscow wrote:
>
>> In my opinion append is a property of a container. Arrays have no such a
>> property, std::array also has no such a property. Associative containers
>> also have no such a property. std::forward_list has no method insert. So a
>> general function will only conduse users.
>> And your "general practice" is not applied in this case because as I said
>> it is a property of a container.
>>
>>
> - append on std array can just return a new array with a larger size and
> new elements.
> - the fact append doesn't work on associative container an just be
> implented with either concept overloading on the container properties (when
> concept are in) or fallback to a static_assert.
> - std::forward_list can also reconstruct a new, larger list with appended
> data
>
> i don't see why it hsould be limited really
>
>
> --
>
> --- 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<std-proposals%2Bunsubscribe@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/ <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/.
--089e0160c66003697d04e95a4746
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr"><div>>append on std array can just return a new array w=
ith a larger size and new elements.</div><div>It could, but that's suff=
iciently different from what append does in other cases, it shouldn't d=
o that. The word for this would be "concat", which would be just =
fine for std::array (as well as other containers).</div>
<div><br></div><div>And actually, I'm not sure it could in all cases --=
e.g. if the begin / end iterator pair size is not known at compile time.</=
div><div><br></div><div>>std::forward_list can also reconstruct a new, l=
arger list with appended data</div>
<div>Same comment as before. That would not be an append, it would be a con=
cat. If there should be nonmember concat that's one thing, but what you=
describe is not an append. The word "append" implies that the or=
iginal sequence was modified.</div>
</div><div class=3D"gmail_extra"><br clear=3D"all"><div><div dir=3D"ltr"><d=
iv>Billy O'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"_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:24 PM, Joel Fa=
lcou <span dir=3D"ltr"><<a href=3D"mailto:joel.falcou@gmail.com" target=
=3D"_blank">joel.falcou@gmail.com</a>></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 class=3D"im">On 22/10/2013 22:24, Vlad from Moscow 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-l=
eft-style:solid">
In my opinion append is a property of a container. Arrays have no such a pr=
operty, std::array also has no such a property. Associative containers also=
have no such a property. std::forward_list has no method insert. So a gene=
ral function will only conduse users.<br>
And your "general practice" is not applied in this case because a=
s I said it is a property of a container.<br>
<br>
</blockquote>
<br></div>
- append on std array can just return a new array with a larger size and ne=
w elements.<br>
- the fact append doesn't work on associative container an just be impl=
ented with either concept overloading on the container properties (when con=
cept are in) or fallback to a static_assert.<br>
- std::forward_list can also reconstruct a new, larger list with appended d=
ata<br>
<br>
i don't see why it hsould be limited really<div class=3D"HOEnZb"><div c=
lass=3D"h5"><br>
<br>
-- <br>
<br>
--- You received this message because you are subscribed to the Google Grou=
ps "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"mailto:std-proposals%2Bunsubscribe@isocpp.org" target=3D=
"_blank">std-proposals+unsubscribe@<u></u>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/<u></u>isocpp.=
org/group/std-<u></u>proposals/</a>.<br>
</div></div></blockquote></div><br></div>
<p></p>
-- <br />
<br />
--- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals" 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 />
--089e0160c66003697d04e95a4746--
.
Author: Ville Voutilainen <ville.voutilainen@gmail.com>
Date: Tue, 22 Oct 2013 23:32:38 +0300
Raw View
--047d7bdc9c523159b304e95a4dc1
Content-Type: text/plain; charset=ISO-8859-1
On 22 October 2013 23:18, Billy O'Neal <billy.oneal@gmail.com> wrote:
> 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 } )
>
>
>
I don't think adding a free append function helps anybody. It doesn't
really fit into the existing
style of container modifiers, so it would be quite an oddball function. And
adding a
new member function for the various containers gets a "meh" from me, too.
--
---
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/.
--047d7bdc9c523159b304e95a4dc1
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr"><br><div class=3D"gmail_extra"><br><br><div class=3D"gmail=
_quote">On 22 October 2013 23:18, Billy O'Neal <span dir=3D"ltr"><<a=
href=3D"mailto:billy.oneal@gmail.com" target=3D"_blank">billy.oneal@gmail.=
com</a>></span> wrote:<br>
<blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1p=
x #ccc solid;padding-left:1ex"><div dir=3D"ltr"><div>I don't see why </=
div><div class=3D"im"><div>append( v, { 1, 2, 3, 4 } )</div></div><div>rais=
es any more question about what is actually returned when compared with</di=
v>
<div>v.append( { 1, 2, 3, 4 } )</div></div><div class=3D"gmail_extra"><div =
class=3D"im">
<br><br></div></div></blockquote><div><br></div><div>I don't think addi=
ng a free append function helps anybody. It doesn't really fit into the=
existing<br>style of container modifiers, so it would be quite an oddball =
function. And adding a<br>
new member function for the various containers gets a "meh" from =
me, too.<br></div></div><br></div></div>
<p></p>
-- <br />
<br />
--- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals" 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 />
--047d7bdc9c523159b304e95a4dc1--
.
Author: Evgeny Panasyuk <evgeny.panasyuk@gmail.com>
Date: Tue, 22 Oct 2013 13:34:52 -0700 (PDT)
Raw View
------=_Part_3845_5189248.1382474092684
Content-Type: text/plain; charset=ISO-8859-1
> In my opinion append is a property of a container.
>
Why?
> Arrays have no such a property, std::array also has no such a property.
>
Great, it will fail to compile. What is problem?
> Associative containers also have no such a property. std::forward_list has
> no method insert. So a general function will only conduse users.
>
I don't see problem here either.
And your "general practice" is not applied in this case because as I said
> it is a property of a container.
>
STL containers are not only one containers that exist. There are many
others.
For instance non-member append would work with boost::container::vector or
boost::container::deque without any modification.
There are also proprietary containers which are not even in public domain -
such append would work on them too.
I just don't see any reason why you want to duplicate that method for each
container.
--
---
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/.
------=_Part_3845_5189248.1382474092684
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr"><br><blockquote class=3D"gmail_quote" style=3D"margin: 0;m=
argin-left: 0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;"><div dir=
=3D"ltr"><div>In my opinion append is a property of a container.</div></div=
></blockquote><div><br>Why?<br> </div><blockquote class=3D"gmail_quote=
" style=3D"margin: 0;margin-left: 0.8ex;border-left: 1px #ccc solid;padding=
-left: 1ex;"><div dir=3D"ltr"><div>Arrays have no such a property, std::arr=
ay also has no such a property.</div></div></blockquote><div><br>Great, it =
will fail to compile. What is problem?<br> </div><blockquote class=3D"=
gmail_quote" style=3D"margin: 0;margin-left: 0.8ex;border-left: 1px #ccc so=
lid;padding-left: 1ex;"><div dir=3D"ltr"><div>Associative containers also h=
ave no such a property. std::forward_list has no method insert. So a genera=
l function will only conduse users. <br></div></div></blockquote><div><br>&=
nbsp;I don't see problem here either.<br><br></div><blockquote class=3D"gma=
il_quote" style=3D"margin: 0;margin-left: 0.8ex;border-left: 1px #ccc solid=
;padding-left: 1ex;"><div dir=3D"ltr"><div>And your "general practice" is n=
ot applied in this case because as I said it is a property of a container.<=
/div></div></blockquote><div><br><br>STL containers are not only one contai=
ners that exist. There are many others.<br>For instance non-member append w=
ould work with boost::container::vector or boost::container::deque without =
any modification.<br>There are also proprietary containers which are not ev=
en in public domain - such append would work on them too.<br>I just don't s=
ee any reason why you want to duplicate that method for each container.<br>=
</div></div>
<p></p>
-- <br />
<br />
--- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals" 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_3845_5189248.1382474092684--
.
Author: "Billy O'Neal" <billy.oneal@gmail.com>
Date: Tue, 22 Oct 2013 13:34:41 -0700
Raw View
--001a1133073eeceb1a04e95a5621
Content-Type: text/plain; charset=ISO-8859-1
Yeah, this should really start as a cohesive library first e.g. in Boost
with other similar functions things go that way. Also depends on what we
get out of the Ranges SG.
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:32 PM, Ville Voutilainen <
ville.voutilainen@gmail.com> wrote:
>
>
>
> On 22 October 2013 23:18, Billy O'Neal <billy.oneal@gmail.com> wrote:
>
>> 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 } )
>>
>>
>>
> I don't think adding a free append function helps anybody. It doesn't
> really fit into the existing
> style of container modifiers, so it would be quite an oddball function.
> And adding a
> new member function for the various containers gets a "meh" from me, too.
>
> --
>
> ---
> 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/.
>
--
---
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/.
--001a1133073eeceb1a04e95a5621
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr"><div>Yeah, this should really start as a cohesive library=
=A0first e.g. in Boost with other similar functions things go that way. Als=
o depends on what we get out of the Ranges SG.</div></div><div class=3D"gma=
il_extra">
<br clear=3D"all"><div><div dir=3D"ltr"><div>Billy O'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:32 PM, Ville V=
outilainen <span dir=3D"ltr"><<a href=3D"mailto:ville.voutilainen@gmail.=
com" target=3D"_blank">ville.voutilainen@gmail.com</a>></span> wrote:<br=
><blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1=
px #ccc solid;padding-left:1ex">
<div dir=3D"ltr"><br><div class=3D"gmail_extra"><br><br><div class=3D"gmail=
_quote"><div class=3D"im">On 22 October 2013 23:18, Billy O'Neal <span =
dir=3D"ltr"><<a href=3D"mailto:billy.oneal@gmail.com" target=3D"_blank">=
billy.oneal@gmail.com</a>></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-l=
eft-style:solid"><div dir=3D"ltr"><div>I don't see why </div><div><div>=
append( v, { 1, 2, 3, 4 } )</div>
</div><div>raises any more question about what is actually returned when co=
mpared with</div>
<div>v.append( { 1, 2, 3, 4 } )</div></div><div class=3D"gmail_extra"><div>
<br><br></div></div></blockquote><div><br></div></div><div>I don't thin=
k adding a free append function helps anybody. It doesn't really fit in=
to the existing<br>style of container modifiers, so it would be quite an od=
dball function. And adding a<br>
new member function for the various containers gets a "meh" from =
me, too.<br></div></div><br></div></div><div class=3D"HOEnZb"><div class=3D=
"h5">
<p></p>
-- <br>
=A0<br>
--- <br>
You received this message because you are subscribed to the Google Groups &=
quot;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"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 />
<br />
--- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals" 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 />
--001a1133073eeceb1a04e95a5621--
.
Author: Evgeny Panasyuk <evgeny.panasyuk@gmail.com>
Date: Tue, 22 Oct 2013 13:40:14 -0700 (PDT)
Raw View
------=_Part_612_23445682.1382474414123
Content-Type: text/plain; charset=ISO-8859-1
> Yeah, this should really start as a cohesive library first e.g. in Boost
> with other similar functions things go that way.
>
I agree. Boost already has non-member push_back:
http://www.boost.org/doc/libs/1_54_0/libs/range/doc/html/range/reference/algorithms/new/push_back.html
And it should not be just one function. It could be a set of functions:
http://www.boost.org/doc/libs/1_54_0/libs/range/doc/html/range/reference/algorithms/new.html
> Also depends on what we get out of the Ranges SG.
>
Plus, interface depends on which concepts we would get.
--
---
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/.
------=_Part_612_23445682.1382474414123
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr"><div></div><blockquote class=3D"gmail_quote" style=3D"marg=
in: 0;margin-left: 0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;"><d=
iv dir=3D"ltr"><div>Yeah, this should really start as a cohesive library&nb=
sp;first e.g. in Boost with other similar functions things go that way. </d=
iv></div></blockquote><div><br>I agree. Boost already has non-member push_b=
ack: http://www.boost.org/doc/libs/1_54_0/libs/range/doc/html/range/referen=
ce/algorithms/new/push_back.html<br>And it should not be just one function.=
It could be a set of functions: http://www.boost.org/doc/libs/1_54_0/libs/=
range/doc/html/range/reference/algorithms/new.html<br> </div><blockquo=
te class=3D"gmail_quote" style=3D"margin: 0;margin-left: 0.8ex;border-left:=
1px #ccc solid;padding-left: 1ex;"><div dir=3D"ltr"><div>Also depends on w=
hat we get out of the Ranges SG.<br clear=3D"all"></div></div></blockquote>=
<div><br>Plus, interface depends on which concepts we would get.<br></div><=
/div>
<p></p>
-- <br />
<br />
--- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals" 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_612_23445682.1382474414123--
.
Author: Vlad from Moscow <vlad.moscow@mail.ru>
Date: Tue, 22 Oct 2013 13:52:06 -0700 (PDT)
Raw View
------=_Part_3749_31521690.1382475126622
Content-Type: text/plain; charset=KOI8-R
Content-Transfer-Encoding: quoted-printable
At least because as a general rule if a function that deals with=20
two objects and is declared as a member function it usually=20
returns reference to "this" object. On the other hand, if such a function=
=20
is declared as a non-member function it usually returns a new object.=20
Moreover this call
=20
append( v, { a, 2, 3, 4 } );
=20
looks like two containers are used so any reader can not exclude that the=
=20
function is declared as
=20
std::vector<int> append( const std::vector<int> &v1, const std::vector<int>=
=20
&v2 );
=20
A non-member function append looks like operator overloading in C# where=20
overloaded operators are declared as static member functions and return a=
=20
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=20
> append( v, { 1, 2, 3, 4 } )
> raises any more question about what is actually returned when compared wi=
th
> v.append( { 1, 2, 3, 4 } )
>
> 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:17 PM, Vlad from Moscow <vlad....@mail.ru<javas=
cript:>
> > wrote:
>
>> If v.append( /*...*/ ) indeed will not return the vector itself then I=
=20
>> could agree with you that a non-member function can be introduced. But i=
n=20
>> my opinion only this call
>> =20
>> append( v, { 1, 2, 3, 4 } )
>> =20
>> 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=20
>> =CE=C1=D0=C9=D3=C1=CC:
>>
>>> >From the second call it is not clear what is outputed whether it is a=
=20
>>> new vector or it is the original vector.
>>>
>>> I disagree. You can use nonmember append with basic_string, and the nam=
e=20
>>> "append" implies modifying the original vector. There's nothing about t=
he=20
>>> syntactical difference between member and nommember functions which cle=
arly=20
>>> indicates "this modifies" or "this does not modify".
>>>
>>> That is, there's no reason "v.append(xyz)" doesn't return a different=
=20
>>> vector either, by this logic.
>>>
>>> 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:03 PM, Vlad from Moscow <vlad....@mail.ru>wro=
te:
>>>
>>>> =20
>>>> In this case you can not substituted a call of the method for=20
>>>> std::basic_string with a call for a vector. So the interface will not =
be=20
>>>> consistent.=20
>>>> =20
>>>> Apart from this the call
>>>> =20
>>>> std::cout << v.append( { 1, 2, 3, 4, 5 } );
>>>> =20
>>>> looks semantically more clear than
>>>> =20
>>>> std::cout << append( v, { 1, 2, 3, 4, 5 } );
>>>> =20
>>>> From the second call it is not clear what is outputed whether it is a=
=20
>>>> 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 UT=
C+4 =D0=CF=CC=D8=DA=CF=D7=C1=D4=C5=CC=D8 Billy O'Neal=20
>>>> =CE=C1=D0=C9=D3=C1=CC:
>>>>
>>>>> I suppose I understand why there's no append here -- append on=20
>>>>> basic_string is the same thing effectively as operator+=3D -- but the=
re's no=20
>>>>> such semantic operation that makes sense for vector.
>>>>>
>>>>> I suppose there's no reason for someone who wants this semantic not t=
o=20
>>>>> 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://stackove=
rflow.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>w=
rote:
>>>>>
>>>>>> Taking into account method append of std::basic_string it is not a=
=20
>>>>>> new name. append and insert will have differenct semantic. append wi=
ll=20
>>>>>> return reference to the container itself. So you can use it for exam=
ple the=20
>>>>>> follwoing way
>>>>>> =20
>>>>>> std::vector<int> v =3D { 1, 2, 3, 4, 5 };
>>>>>> =20
>>>>>> for ( int x : v.append( { 4, 3, 2, 1 } ) ) std::cout << x << ' ';
>>>>>> =20
>>>>>> insert is used then you need the position after inserting new=20
>>>>>> elements. For example
>>>>>> =20
>>>>>> auto pos =3D v.end();
>>>>>> =20
>>>>>> 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=20
>>>>>> Gustafsson =CE=C1=D0=C9=D3=C1=CC:
>>>>>>
>>>>>>> I think the idea is good, this use case appears quite often. But wh=
y=20
>>>>>>> not overload push_back with more signatures instead of introducing =
a new=20
>>>>>>> name? The signatures available would then be exactly parallel to in=
sert(),=20
>>>>>>> with the difference that the first parameter is absent.
>>>>>>>
>>>>>>>
>>>>>>> Den tisdagen den 22:e oktober 2013 kl. 01:20:59 UTC+2 skrev Evgeny=
=20
>>>>>>> Panasyuk:
>>>>>>>>
>>>>>>>>
>>>>>>>> No, I do not think so.
>>>>>>>>>
>>>>>>>>
>>>>>>>> Why not?
>>>>>>>> =20
>>>>>>>>
>>>>>>>>> It is common interface of all sequential containers including and=
=20
>>>>>>>>> together with std::basic_string.
>>>>>>>>>
>>>>>>>>
>>>>>>>> Just read GotW #84.
>>>>>>>> std::string has many controversial design decisions. We should not=
=20
>>>>>>>> uglify STL by borrowing bad stuff from std::string.
>>>>>>>>
>>>>>>> --=20
>>>>>> =20
>>>>>> ---=20
>>>>>> You received this message because you are subscribed to the Google=
=20
>>>>>> Groups "ISO C++ Standard - Future Proposals" group.
>>>>>> To unsubscribe from this group and stop receiving emails from it,=20
>>>>>> 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.org=
/group/std-proposals/>
>>>>>> .
>>>>>>
>>>>>
>>>>> --=20
>>>> =20
>>>> ---=20
>>>> You received this message because you are subscribed to the Google=20
>>>> Groups "ISO C++ Standard - Future Proposals" group.
>>>> To unsubscribe from this group and stop receiving emails from it, send=
=20
>>>> 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/=
>
>>>> .
>>>>
>>>
>>> --=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_3749_31521690.1382475126622
Content-Type: text/html; charset=KOI8-R
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr"><div>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. O=
n the other hand, if such a function is declared as a non-member funct=
ion it usually returns a new object. </div><div>Moreover this call</di=
v><div> </div><div>append( v, { a, 2, 3, 4 } );</div><div> </div>=
<div>looks like two containers are used so any reader can not exclude that =
the function is declared as</div><div> </div><div>std::vector<=
int> append( const std::vector<int> &v1, const std::vector<=
int> &v2 );</div><div> </div><div>A non-member function append =
looks like operator overloading in C# where overloaded operators are d=
eclared as static member functions and return a new object.</div><div><br>=
=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:</div>=
<blockquote class=3D"gmail_quote" style=3D"margin: 0px 0px 0px 0.8ex; paddi=
ng-left: 1ex; border-left-color: rgb(204, 204, 204); border-left-width: 1px=
; border-left-style: solid;"><div dir=3D"ltr"><div>I don't see why </div><d=
iv>append( v, { 1, 2, 3, 4 } )</div><div>raises any more question about wha=
t is actually returned when compared with</div><div>v.append( { 1, 2, 3, 4 =
} )</div></div><div>
<br clear=3D"all"><div><div dir=3D"ltr"><div>Billy O'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"_blank">http://stackoverflow.com/<wbr>users/82320/bi=
lly-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:17 PM, Vlad fr=
om Moscow <span dir=3D"ltr"><<a href=3D"javascript:" target=3D"_blank" g=
df-obfuscated-mailto=3D"ezZ55YB7FGoJ">vlad....@mail.ru</a>></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>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> </div><div>appen=
d( v, { 1, 2, 3, 4 } )</div>
<div> </div><div>can arise a question what is actually returned.</div>=
<div><br>=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:</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-left-style: solid;">
<div><div dir=3D"ltr"><div>>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 "append" implies modifying the original vector. There's noth=
ing about the syntactical difference between member and nommember functions=
which clearly indicates "this modifies" or "this does not modify".</div>
<div><br></div><div>That is, there's no reason "v.append(xyz)" doesn't retu=
rn a different vector either, by this logic.</div></div></div><div><div><br=
clear=3D"all"><div><div dir=3D"ltr"><div>Billy O'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"_blank">http://stackoverflow.com/<u></u>=
users<wbr>/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"><<a>vlad....@mail.ru</a>>=
</span> wrote:<br><blockquote class=3D"gmail_quote" style=3D"margin: 0px 0p=
x 0px 0.8ex; padding-left: 1ex; border-left-color: rgb(204, 204, 204); bord=
er-left-width: 1px; border-left-style: solid;">
<div dir=3D"ltr"><div> </div><div>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. </div><div> </div><div>Apart =
from this the call</div>
<div> </div><div>std::cout << v.append( { 1, 2, 3, 4, 5 } );</di=
v><div> </div><div>looks semantically more clear than</div><div> =
</div><div>std::cout << append( v, { 1, 2, 3, 4, 5 } );</div><div>&nb=
sp;</div><div>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 =C7., 21=
:37:19 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><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>I suppose I understand why there's no append here -- =
append on basic_string is the same thing effectively as operator+=3D -- but=
there's no such semantic operation that makes sense for vector.<div>
<br>
</div><div>I suppose there's no reason for someone who wants this semantic =
not to do:</div><div><br></div><div>template <typename T, typename Input=
Iterator></div><div>T& append(T& container, InputIterator first,=
InputIterator last)</div>
<div>{</div><div> container.insert(container.<u></u>end<u></u>=
<wbr>(), first, last);</div><div> return container;</div><div>=
}</div></div><div><div><div><br clear=3D"all"><div><div dir=3D"ltr"><div>Bi=
lly O'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><wbr>/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"><<a>vlad....@mail.ru</a>></spa=
n> wrote:<br></div><blockquote class=3D"gmail_quote" style=3D"margin: 0px 0=
px 0px 0.8ex; padding-left: 1ex; border-left-color: rgb(204, 204, 204); bor=
der-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> </div><div>std::vector<int> v =3D { 1, 2, 3, 4, 5 };</div>=
<div> </div><div>for ( int x : v.append( { 4, 3, 2, 1 } ) ) std::=
cout << x << ' ';</div><div> </div><div>insert is used the=
n you need the position after inserting new elements. For example</div>
<div> </div><div>auto pos =3D v.end();</div><div> </div><div>pos =
=3D v.insert( pos, { 4, 3, 2, 1 } );</div><div>v.insert( pos, 5 );</di=
v><div><br>=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:</div>
<div><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-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 wi=
th more signatures instead of introducing a new name? The signatures availa=
ble would then be exactly parallel to insert(), with the difference that th=
e first parameter 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.8=
ex; padding-left: 1ex; border-left-color: rgb(204, 204, 204); border-left-w=
idth: 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); b=
order-left-width: 1px; border-left-style: solid;"><div dir=3D"ltr"><div>No,=
I do not think so.</div>
</div></blockquote><div><br>Why not?<br> </div><blockquote class=3D"gm=
ail_quote" style=3D"margin: 0px 0px 0px 0.8ex; padding-left: 1ex; border-le=
ft-color: rgb(204, 204, 204); border-left-width: 1px; border-left-style: so=
lid;"><div dir=3D"ltr">
<div>It is common interface of all sequential containers including&nbs=
p;and together with std::basic_string.</div></div></blockquote><div><br>Jus=
t read GotW #84.<br>std::string has many controversial design decisions. We=
should 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>
<br>
--- <br>
You received this message because you are subscribed to the Google Groups "=
ISO C++ Standard - Future Proposals" 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><wbr>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>
<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>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<wbr=
>cpp.org/group/std-<u></u>proposals/</a>.<br>
</div></div></blockquote></div><br></div></div></div>
</blockquote></div><div><div>
<p></p>
-- <br>
<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"=
ezZ55YB7FGoJ">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"ezZ55YB7FGoJ">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>
</div></div></blockquote></div><br></div>
</blockquote></div>
<p></p>
-- <br />
<br />
--- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals" 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_3749_31521690.1382475126622--
.
Author: Vlad from Moscow <vlad.moscow@mail.ru>
Date: Tue, 22 Oct 2013 13:54:47 -0700 (PDT)
Raw View
------=_Part_467_21682825.1382475287466
Content-Type: text/plain; charset=KOI8-R
Content-Transfer-Encoding: quoted-printable
=D3=D2=C5=C4=C1, 23 =CF=CB=D4=D1=C2=D2=D1 2013 =C7., 0:26:27 UTC+4 =D0=CF=
=CC=D8=DA=CF=D7=C1=D4=C5=CC=D8 Evgeny Panasyuk=20
=CE=C1=D0=C9=D3=C1=CC:
>
> As I said I do not see a great sense to make the method as a non-member=
=20
>> function. In my opinion it is a wrong approach because if to do so the=
=20
>> question arises what to do with arrays.
>>
>
> It will just fail to compile, just as it should.
>
> They have no method insert. Also what to do with other containers that=20
>> also have no method insert as for example std::forward_list?
>>
>
> There are ways to implement special versions for std::forward_list, like=
=20
> overloading.
> But at first, which semantic you want to have for append( fwd_list, ... )=
=20
> ? std::forward_list does not even have push_back - I think it should just=
=20
> fail on append.
>
It is a good note. It seems you are starting to understand that append is a=
=20
property of a container. Look how I named the thread.
=20
=20
--=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_467_21682825.1382475287466
Content-Type: text/html; charset=KOI8-R
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr"><br>=D3=D2=C5=C4=C1, 23 =CF=CB=D4=D1=C2=D2=D1 2013 =
=C7., 0:26:27 UTC+4 =D0=CF=CC=D8=DA=CF=D7=C1=D4=C5=CC=D8 Evgeny Panasyuk =
=CE=C1=D0=C9=D3=C1=CC:<blockquote class=3D"gmail_quote" style=3D"margin: 0p=
x 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"><blockq=
uote 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; borde=
r-left-style: solid;"><div dir=3D"ltr"><div>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 wr=
ong approach because if to do so the question arises what to do with arrays=
..</div></div></blockquote><div><br>It will just fail to compile, just as it=
should.<br><br></div><blockquote class=3D"gmail_quote" style=3D"margin: 0p=
x 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>Th=
ey have no method insert. Also what to do with other containers that also h=
ave no method insert as for example std::forward_list?</div></div></blockqu=
ote><div><br>There are ways to implement special versions for std::forward_=
list, like overloading.<br>But at first, which semantic you want to have fo=
r append( fwd_list, ... ) ? std::forward_list does not even have push_back =
- I think it should just fail on append.<br></div></div></blockquote><div>I=
t is a good note. It seems you are starting to understand that append is a =
property of a container. Look how I named the thread.</div><div> </div=
><div> </div></div>
<p></p>
-- <br />
<br />
--- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals" 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_467_21682825.1382475287466--
.
Author: Vlad from Moscow <vlad.moscow@mail.ru>
Date: Tue, 22 Oct 2013 14:01:46 -0700 (PDT)
Raw View
------=_Part_350_14812551.1382475706999
Content-Type: text/plain; charset=KOI8-R
Content-Transfer-Encoding: quoted-printable
In this case we will have different semantics. In my opinion it is not a=20
good idea. I am sure that append should be introduced only for sequantial=
=20
containers that have method push_back as std::basic_string, std::vector,=20
std::deque, std::list, and std::x_forward_list for which I am going to=20
write a proposal as I already announced in this forum.
=D3=D2=C5=C4=C1, 23 =CF=CB=D4=D1=C2=D2=D1 2013 =C7., 0:24:12 UTC+4 =D0=CF=
=CC=D8=DA=CF=D7=C1=D4=C5=CC=D8 Joel Falcou =CE=C1=D0=C9=D3=C1=CC:
> On 22/10/2013 22:24, Vlad from Moscow wrote:=20
> > In my opinion append is a property of a container. Arrays have no such=
=20
> > a property, std::array also has no such a property. Associative=20
> > containers also have no such a property. std::forward_list has no=20
> > method insert. So a general function will only conduse users.=20
> > And your "general practice" is not applied in this case because as I=20
> > said it is a property of a container.=20
> >=20
>
> - append on std array can just return a new array with a larger size and=
=20
> new elements.=20
> - the fact append doesn't work on associative container an just be=20
> implented with either concept overloading on the container properties=20
> (when concept are in) or fallback to a static_assert.=20
> - std::forward_list can also reconstruct a new, larger list with=20
> appended data=20
>
> i don't see why it hsould be limited really=20
>
>
--=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_350_14812551.1382475706999
Content-Type: text/html; charset=KOI8-R
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr"><div>In this case we will have different semantics. In my =
opinion it is not a good idea. I am sure that append should be introduced o=
nly for sequantial containers that have method push_back as std::basic=
_string, std::vector, std::deque, std::list, and std::x_forward_list for wh=
ich I am going to write a proposal as I already announced in this foru=
m.</div><div><br>=D3=D2=C5=C4=C1, 23 =CF=CB=D4=D1=C2=D2=D1 2013 =C7., =
0:24:12 UTC+4 =D0=CF=CC=D8=DA=CF=D7=C1=D4=C5=CC=D8 Joel Falcou =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-left-style: solid;">On 22/10/2013 22:24, Vlad from=
Moscow wrote:
<br>> In my opinion append is a property of a container. Arrays have no =
such=20
<br>> a property, std::array also has no such a property. Associative=20
<br>> containers also have no such a property. std::forward_list has no=
=20
<br>> method insert. So a general function will only conduse users.
<br>> And your "general practice" is not applied in this case because as=
I=20
<br>> said it is a property of a container.
<br>>
<br>
<br>- append on std array can just return a new array with a larger size an=
d=20
<br>new elements.
<br>- the fact append doesn't work on associative container an just be=20
<br>implented with either concept overloading on the container properties=
=20
<br>(when concept are in) or fallback to a static_assert.
<br>- std::forward_list can also reconstruct a new, larger list with=20
<br>appended data
<br>
<br>i don't see why it hsould be limited really
<br>
<br></blockquote></div>
<p></p>
-- <br />
<br />
--- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals" 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_350_14812551.1382475706999--
.
Author: Evgeny Panasyuk <evgeny.panasyuk@gmail.com>
Date: Tue, 22 Oct 2013 14:03:11 -0700 (PDT)
Raw View
------=_Part_307_5879483.1382475791259
Content-Type: text/plain; charset=ISO-8859-1
> 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.
>
Where did this rule come from?
--
---
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/.
------=_Part_307_5879483.1382475791259
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr"><br><blockquote class=3D"gmail_quote" style=3D"margin: 0;m=
argin-left: 0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;"><div dir=
=3D"ltr"><div>At least because as a general rule if a function that&nb=
sp; deals with two objects and is declared as a member =
function it usually returns reference to "this" object. On the ot=
her hand, if such a function is declared as a non-member function it u=
sually returns a new object. </div></div></blockquote><div><br><span i=
d=3D"result_box" class=3D"short_text" lang=3D"en"><span class=3D"hps">Where=
did this</span> <span class=3D"hps">rule</span> <span class=3D"hps">come f=
rom?</span></span><br></div></div>
<p></p>
-- <br />
<br />
--- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals" 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_307_5879483.1382475791259--
.
Author: Ville Voutilainen <ville.voutilainen@gmail.com>
Date: Wed, 23 Oct 2013 00:03:43 +0300
Raw View
--089e0149bc0660294104e95abc78
Content-Type: text/plain; charset=ISO-8859-1
On 22 October 2013 23:52, Vlad from Moscow <vlad.moscow@mail.ru> wrote:
> 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
>
>
I'm pretty sure there's no such general rule in the standard.
--
---
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/.
--089e0149bc0660294104e95abc78
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr"><br><div class=3D"gmail_extra"><br><br><div class=3D"gmail=
_quote">On 22 October 2013 23:52, Vlad from Moscow <span dir=3D"ltr"><<a=
href=3D"mailto:vlad.moscow@mail.ru" target=3D"_blank">vlad.moscow@mail.ru<=
/a>></span> wrote:<br>
<blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1p=
x #ccc solid;padding-left:1ex"><div dir=3D"ltr"><div>At least because=A0as =
a general rule if a function that=A0=A0deals with two=A0objects=A0and is=A0=
declared as a member function it usually returns=A0reference to=A0"thi=
s" object. On the other hand, if=A0such a function is<br>
<br></div></div></blockquote><div><br></div><div>I'm pretty sure there&=
#39;s no such general rule in the standard. <br></div></div><br></div></div=
>
<p></p>
-- <br />
<br />
--- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals" 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 />
--089e0149bc0660294104e95abc78--
.
Author: Evgeny Panasyuk <evgeny.panasyuk@gmail.com>
Date: Tue, 22 Oct 2013 14:05:53 -0700 (PDT)
Raw View
------=_Part_3758_29878374.1382475953753
Content-Type: text/plain; charset=ISO-8859-1
>
> There are ways to implement special versions for std::forward_list, like
>> overloading.
>> But at first, which semantic you want to have for append( fwd_list, ... )
>> ? std::forward_list does not even have push_back - I think it should just
>> fail on append.
>>
> It is a good note. It seems you are starting to understand that append is
> a property of a container. Look how I named the thread.
>
Different containers fulfil different concepts. For some append can be
easily implemented, for others not.
But that is not reasoning for member version.
--
---
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/.
------=_Part_3758_29878374.1382475953753
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr"><blockquote class=3D"gmail_quote" style=3D"margin: 0;margi=
n-left: 0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;"><div dir=3D"l=
tr"><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:1px;bord=
er-left-style:solid"><div dir=3D"ltr"><div>There are ways to implement spec=
ial versions for std::forward_list, like overloading.<br>But at first, whic=
h semantic you want to have for append( fwd_list, ... ) ? std::forward_list=
does not even have push_back - I think it should just fail on append.<br><=
/div></div></blockquote><div>It is a good note. It seems you are starting t=
o understand that append is a property of a container. Look how I named the=
thread.</div></div></blockquote><div><br>Different containers fulfil diffe=
rent concepts. For some append can be easily implemented, for others not.<b=
r>But that is not <span id=3D"result_box" class=3D"short_text" lang=3D"en">=
<span class=3D"hps alt-edited">reasoning for member version.<br></span></sp=
an></div></div>
<p></p>
-- <br />
<br />
--- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals" 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_3758_29878374.1382475953753--
.
Author: Evgeny Panasyuk <evgeny.panasyuk@gmail.com>
Date: Tue, 22 Oct 2013 14:11:06 -0700 (PDT)
Raw View
------=_Part_397_22731323.1382476266583
Content-Type: text/plain; charset=ISO-8859-1
>
> In this case we will have different semantics. In my opinion it is not a
> good idea. I am sure that append should be introduced only for sequantial
> containers that have method push_back as std::basic_string, std::vector,
> std::deque, std::list, and std::x_forward_list
>
Why not just make non-member function which works for all sequence
containers?
> for which I am going to write a proposal as I already announced in this
> forum.
>
Do you want to modify requirements of sequence container with member that
does not add any value?
--
---
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/.
------=_Part_397_22731323.1382476266583
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr"><blockquote class=3D"gmail_quote" style=3D"margin: 0;margi=
n-left: 0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;"><div dir=3D"l=
tr"><div>In this case we will have different semantics. In my opinion it is=
not a good idea. I am sure that append should be introduced only for =
sequantial containers that have method push_back as std::basic_string, std:=
:vector, std::deque, std::list, and std::x_forward_list</div></div></blockq=
uote><div><br>Why not just make non-member function which works for all seq=
uence containers?<br> </div><blockquote class=3D"gmail_quote" style=3D=
"margin: 0;margin-left: 0.8ex;border-left: 1px #ccc solid;padding-left: 1ex=
;"><div dir=3D"ltr"><div>for which I am going to write a proposal as I alre=
ady announced in this forum.</div></div></blockquote><div><br>Do you w=
ant to modify requirements of sequence container with member that does not =
add any value?<br></div></div>
<p></p>
-- <br />
<br />
--- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals" 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_397_22731323.1382476266583--
.
Author: Vlad from Moscow <vlad.moscow@mail.ru>
Date: Tue, 22 Oct 2013 14:20:40 -0700 (PDT)
Raw View
------=_Part_484_3950765.1382476840153
Content-Type: text/plain; charset=KOI8-R
Content-Transfer-Encoding: quoted-printable
I do not like the idea that some non-member functions will be defined only=
=20
for narrow groups of containers. It will only confuse users. Besides it=20
will look strange that std::forward_list will be excluded from sequantial=
=20
containers relative to this function.
=D3=D2=C5=C4=C1, 23 =CF=CB=D4=D1=C2=D2=D1 2013 =C7., 1:11:06 UTC+4 =D0=CF=
=CC=D8=DA=CF=D7=C1=D4=C5=CC=D8 Evgeny Panasyuk=20
=CE=C1=D0=C9=D3=C1=CC:
> In this case we will have different semantics. In my opinion it is not a=
=20
>> good idea. I am sure that append should be introduced only for sequantia=
l=20
>> containers that have method push_back as std::basic_string, std::vector,=
=20
>> std::deque, std::list, and std::x_forward_list
>>
>
> Why not just make non-member function which works for all sequence=20
> containers?
> =20
>
>> for which I am going to write a proposal as I already announced in this=
=20
>> forum.
>>
>
> Do you want to modify requirements of sequence container with member that=
=20
> does not add any value?
>
--=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_484_3950765.1382476840153
Content-Type: text/html; charset=KOI8-R
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr"><div>I do not like the idea that some non-member functions=
will be defined only for narrow groups of containers. It will only confuse=
users. Besides it will look strange that std::forward_list will be&nb=
sp;excluded from sequantial containers relative to this function.</div=
><div><br>=D3=D2=C5=C4=C1, 23 =CF=CB=D4=D1=C2=D2=D1 2013 =C7., 1:11:06=
UTC+4 =D0=CF=CC=D8=DA=CF=D7=C1=D4=C5=CC=D8 Evgeny Panasyuk =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-le=
ft-width: 1px; border-left-style: solid;"><div dir=3D"ltr"><blockquote clas=
s=3D"gmail_quote" style=3D"margin: 0px 0px 0px 0.8ex; padding-left: 1ex; bo=
rder-left-color: rgb(204, 204, 204); border-left-width: 1px; border-left-st=
yle: solid;"><div dir=3D"ltr"><div>In this case we will have different sema=
ntics. In my opinion it is not a good idea. I am sure that append should be=
introduced only for sequantial containers that have method push_back =
as std::basic_string, std::vector, std::deque, std::list, and std::x_forwar=
d_list</div></div></blockquote><div><br>Why not just make non-member functi=
on which works for all sequence containers?<br> </div><blockquote clas=
s=3D"gmail_quote" style=3D"margin: 0px 0px 0px 0.8ex; padding-left: 1ex; bo=
rder-left-color: rgb(204, 204, 204); border-left-width: 1px; border-left-st=
yle: solid;"><div dir=3D"ltr"><div>for which I am going to write a proposal=
as I already announced in this forum.</div></div></blockquote><div><b=
r>Do you want to modify requirements of sequence container with member that=
does not add any value?<br></div></div></blockquote></div>
<p></p>
-- <br />
<br />
--- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals" 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_484_3950765.1382476840153--
.
Author: Evgeny Panasyuk <evgeny.panasyuk@gmail.com>
Date: Tue, 22 Oct 2013 14:30:52 -0700 (PDT)
Raw View
------=_Part_3701_20556321.1382477452872
Content-Type: text/plain; charset=ISO-8859-1
>
> I do not like the idea that some non-member functions will be defined only
> for narrow groups of containers.
>
Some algorithms (non-member function templates) are defined only for narrow
groups of ranges.
There is nothing special in append case.
> It will only confuse users. Besides it will look strange that
> std::forward_list will be excluded from sequantial containers relative to
> this function.
>
There is no surprise - because it supports only part of Sequence container
requirements - Table 100.
Moreover - there is no efficient way to implement append for it.
--
---
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/.
------=_Part_3701_20556321.1382477452872
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr"><blockquote class=3D"gmail_quote" style=3D"margin: 0;margi=
n-left: 0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;"><div dir=3D"l=
tr"><div>I do not like the idea that some non-member functions will be defi=
ned only for narrow groups of containers. </div></div></blockquote><div><br=
>Some algorithms (non-member function templates) are defined only for narro=
w groups of ranges.<br>There is nothing special in append case.<br></div><d=
iv> </div><blockquote class=3D"gmail_quote" style=3D"margin: 0;margin-=
left: 0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;"><div dir=3D"ltr=
"><div>It will only confuse users. Besides it will look strange that std::f=
orward_list will be excluded from sequantial containers rela=
tive to this function.</div></div></blockquote><div><br>There is no surpris=
e - because it supports only part of Sequence container requirements - Tabl=
e 100.<br>Moreover - there is no efficient way to implement append for it.<=
br></div></div>
<p></p>
-- <br />
<br />
--- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals" 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_3701_20556321.1382477452872--
.
Author: Vlad from Moscow <vlad.moscow@mail.ru>
Date: Tue, 22 Oct 2013 14:43:13 -0700 (PDT)
Raw View
------=_Part_371_2512508.1382478193304
Content-Type: text/plain; charset=KOI8-R
Content-Transfer-Encoding: quoted-printable
=D3=D2=C5=C4=C1, 23 =CF=CB=D4=D1=C2=D2=D1 2013 =C7., 1:30:52 UTC+4 =D0=CF=
=CC=D8=DA=CF=D7=C1=D4=C5=CC=D8 Evgeny Panasyuk=20
=CE=C1=D0=C9=D3=C1=CC:
>
> I do not like the idea that some non-member functions will be defined onl=
y=20
>> for narrow groups of containers.=20
>>
>
> Some algorithms (non-member function templates) are defined only for=20
> narrow groups of ranges.
> There is nothing special in append case.
> =20
>
=20
>
>> It will only confuse users. Besides it will look strange that=20
>> std::forward_list will be excluded from sequantial containers relative t=
o=20
>> this function.
>>
>
> There is no surprise - because it supports only part of Sequence containe=
r=20
> requirements - Table 100.
> Moreover - there is no efficient way to implement append for it.
>
=20
In my opinion it will only confuse users. What about other non-member=20
functions that couldl be introduced and will deal with nerrow groups of=20
containers? append is a property of few containers. It is what distiguishes=
=20
them from other containers.
--=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_371_2512508.1382478193304
Content-Type: text/html; charset=KOI8-R
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr"><br>=D3=D2=C5=C4=C1, 23 =CF=CB=D4=D1=C2=D2=D1 2013 =
=C7., 1:30:52 UTC+4 =D0=CF=CC=D8=DA=CF=D7=C1=D4=C5=CC=D8 Evgeny Panasyuk =
=CE=C1=D0=C9=D3=C1=CC:<blockquote class=3D"gmail_quote" style=3D"margin: 0p=
x 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"><blockq=
uote 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; borde=
r-left-style: solid;"><div dir=3D"ltr"><div>I do not like the idea that som=
e non-member functions will be defined only for narrow groups of containers=
.. </div></div></blockquote><div><br>Some algorithms (non-member function te=
mplates) are defined only for narrow groups of ranges.<br>There is nothing =
special in append case.<br></div><div> </div></div></blockquote><block=
quote class=3D"gmail_quote" style=3D"margin: 0px 0px 0px 0.8ex; padding-lef=
t: 1ex; border-left-color: rgb(204, 204, 204); border-left-width: 1px; bord=
er-left-style: solid;"><div dir=3D"ltr"><div> </div><blockquote class=
=3D"gmail_quote" style=3D"margin: 0px 0px 0px 0.8ex; padding-left: 1ex; bor=
der-left-color: rgb(204, 204, 204); border-left-width: 1px; border-left-sty=
le: solid;"><div dir=3D"ltr"><div>It will only confuse users. Besides it wi=
ll look strange that std::forward_list will be excluded from sequ=
antial containers relative to this function.</div></div></blockquote><=
div><br>There is no surprise - because it supports only part of Sequence co=
ntainer requirements - Table 100.<br>Moreover - there is no efficient way t=
o implement append for it.<br></div></div></blockquote><div> </div><di=
v>In my opinion it will only confuse users. What about other non-membe=
r functions that couldl be introduced and will deal with nerrow groups of c=
ontainers? append is a property of few containers. It is what distigui=
shes them from other containers.</div></div>
<p></p>
-- <br />
<br />
--- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals" 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_371_2512508.1382478193304--
.
Author: Vlad from Moscow <vlad.moscow@mail.ru>
Date: Tue, 22 Oct 2013 14:48:29 -0700 (PDT)
Raw View
------=_Part_523_4838600.1382478509947
Content-Type: text/plain; charset=KOI8-R
Content-Transfer-Encoding: quoted-printable
append should be considered as widening of the semantic of push_back and=20
nothing more.
=D3=D2=C5=C4=C1, 23 =CF=CB=D4=D1=C2=D2=D1 2013 =C7., 1:43:13 UTC+4 =D0=CF=
=CC=D8=DA=CF=D7=C1=D4=C5=CC=D8 Vlad from Moscow=20
=CE=C1=D0=C9=D3=C1=CC:
>
> =D3=D2=C5=C4=C1, 23 =CF=CB=D4=D1=C2=D2=D1 2013 =C7., 1:30:52 UTC+4 =D0=CF=
=CC=D8=DA=CF=D7=C1=D4=C5=CC=D8 Evgeny Panasyuk=20
> =CE=C1=D0=C9=D3=C1=CC:
>>
>> I do not like the idea that some non-member functions will be defined=20
>>> only for narrow groups of containers.=20
>>>
>>
>> Some algorithms (non-member function templates) are defined only for=20
>> narrow groups of ranges.
>> There is nothing special in append case.
>> =20
>>
> =20
>>
>>> It will only confuse users. Besides it will look strange that=20
>>> std::forward_list will be excluded from sequantial containers relative =
to=20
>>> this function.
>>>
>>
>> There is no surprise - because it supports only part of Sequence=20
>> container requirements - Table 100.
>> Moreover - there is no efficient way to implement append for it.
>>
> =20
> In my opinion it will only confuse users. What about other non-member=20
> functions that couldl be introduced and will deal with nerrow groups of=
=20
> containers? append is a property of few containers. It is what distiguish=
es=20
> them from other containers.
>
--=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_523_4838600.1382478509947
Content-Type: text/html; charset=KOI8-R
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr"><div>append should be considered as widening of the semant=
ic of push_back and nothing more.</div><div><br>=D3=D2=C5=C4=C1, 23 =CF=CB=
=D4=D1=C2=D2=D1 2013 =C7., 1:43:13 UTC+4 =D0=CF=CC=D8=DA=CF=D7=C1=D4=
=C5=CC=D8 Vlad from Moscow =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-left-style:=
solid;"><div dir=3D"ltr"><br>=D3=D2=C5=C4=C1, 23 =CF=CB=D4=D1=C2=D2=D1 201=
3 =C7., 1:30:52 UTC+4 =D0=CF=CC=D8=DA=CF=D7=C1=D4=C5=CC=D8 Evgeny Pana=
syuk =CE=C1=D0=C9=D3=C1=CC:<blockquote class=3D"gmail_quote" style=3D"margi=
n: 0px 0px 0px 0.8ex; padding-left: 1ex; border-left-color: rgb(204, 204, 2=
04); border-left-width: 1px; border-left-style: solid;"><div dir=3D"ltr"><b=
lockquote 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>I do not like the idea tha=
t some non-member functions will be defined only for narrow groups of conta=
iners. </div></div></blockquote><div><br>Some algorithms (non-member functi=
on templates) are defined only for narrow groups of ranges.<br>There is not=
hing special in append case.<br></div><div> </div></div></blockquote><=
blockquote class=3D"gmail_quote" style=3D"margin: 0px 0px 0px 0.8ex; paddin=
g-left: 1ex; border-left-color: rgb(204, 204, 204); border-left-width: 1px;=
border-left-style: solid;"><div dir=3D"ltr"><div> </div><blockquote c=
lass=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>It will only confuse users. Besides i=
t will look strange that std::forward_list will be excluded from =
sequantial containers relative to this function.</div></div></blockquo=
te><div><br>There is no surprise - because it supports only part of Sequenc=
e container requirements - Table 100.<br>Moreover - there is no efficient w=
ay to implement append for it.<br></div></div></blockquote><div> </div=
><div>In my opinion it will only confuse users. What about other non-m=
ember functions that couldl be introduced and will deal with nerrow groups =
of containers? append is a property of few containers. It is what dist=
iguishes them from other containers.</div></div></blockquote></div>
<p></p>
-- <br />
<br />
--- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals" 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_523_4838600.1382478509947--
.
Author: Vlad from Moscow <vlad.moscow@mail.ru>
Date: Tue, 22 Oct 2013 14:57:56 -0700 (PDT)
Raw View
------=_Part_285_17219572.1382479076141
Content-Type: text/plain; charset=KOI8-R
Content-Transfer-Encoding: quoted-printable
append should be considered as widening of the semantic of push_back and=20
nothing more. For example in class std::vector there is method insert that=
=20
allows to insert one element
=20
iterator insert(const_iterator position, const T& x);
is not there?
=20
At the same time insert allows to insert several elemnts
=20
iterator insert(const_iterator position, size_type n, const T& x);
template <class InputIterator>
iterator insert(const_iterator position,
InputIterator first, InputIterator last);
iterator insert(const_iterator position, initializer_list<T> il);
The same must be valid with push_back. It allows to append one=20
element. What I want that it also would allow to append several elements as=
=20
insert does. Only push_back will be used through its alias append when=20
several elements are needed to append.
=20
That is all.
=D3=D2=C5=C4=C1, 23 =CF=CB=D4=D1=C2=D2=D1 2013 =C7., 1:48:29 UTC+4 =D0=CF=
=CC=D8=DA=CF=D7=C1=D4=C5=CC=D8 Vlad from Moscow=20
=CE=C1=D0=C9=D3=C1=CC:
> append should be considered as widening of the semantic of push_back and=
=20
> nothing more.
>
> =D3=D2=C5=C4=C1, 23 =CF=CB=D4=D1=C2=D2=D1 2013 =C7., 1:43:13 UTC+4 =D0=CF=
=CC=D8=DA=CF=D7=C1=D4=C5=CC=D8 Vlad from Moscow=20
> =CE=C1=D0=C9=D3=C1=CC:
>
>>
>> =D3=D2=C5=C4=C1, 23 =CF=CB=D4=D1=C2=D2=D1 2013 =C7., 1:30:52 UTC+4 =D0=
=CF=CC=D8=DA=CF=D7=C1=D4=C5=CC=D8 Evgeny Panasyuk=20
>> =CE=C1=D0=C9=D3=C1=CC:
>>>
>>> I do not like the idea that some non-member functions will be defined=
=20
>>>> only for narrow groups of containers.=20
>>>>
>>>
>>> Some algorithms (non-member function templates) are defined only for=20
>>> narrow groups of ranges.
>>> There is nothing special in append case.
>>> =20
>>>
>> =20
>>>
>>>> It will only confuse users. Besides it will look strange that=20
>>>> std::forward_list will be excluded from sequantial containers relative=
to=20
>>>> this function.
>>>>
>>>
>>> There is no surprise - because it supports only part of Sequence=20
>>> container requirements - Table 100.
>>> Moreover - there is no efficient way to implement append for it.
>>>
>> =20
>> In my opinion it will only confuse users. What about other non-member=20
>> functions that couldl be introduced and will deal with nerrow groups of=
=20
>> containers? append is a property of few containers. It is what distiguis=
hes=20
>> them from other containers.
>>
>
--=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_285_17219572.1382479076141
Content-Type: text/html; charset=KOI8-R
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr"><div><div>append should be considered as widening of the s=
emantic of push_back and nothing more. For example in class std::vector the=
re is method insert that allows to insert one element</div><div> </div=
><font face=3D"LMMono9-Regular" size=3D"1"><font face=3D"LMMono9-Regular" s=
ize=3D"1"><p>iterator insert(const_iterator position, const T& x);</p><=
div></div></font><div></div></font><div>is not there?</div><div> </div=
><div>At the same time insert allows to insert several elemnts</div><div>&n=
bsp;</div><div><font face=3D"LMMono9-Regular" size=3D"1"><font face=3D"LMMo=
no9-Regular" size=3D"1"><p align=3D"LEFT">iterator insert(const_iterator po=
sition, size_type n, const T& x);</p>
<p align=3D"LEFT">template <class InputIterator></p>
<p align=3D"LEFT">iterator insert(const_iterator position,</p>
<p align=3D"LEFT">InputIterator first, InputIterator last);</p>
<p>iterator insert(const_iterator position, initializer_list<T> il);<=
/p></font></font>The same must be valid with push_back. It allows to a=
ppend one element. What I want that it also would allow to append seve=
ral elements as insert does. Only push_back will be used through its a=
lias append when several elements are needed to append.</div><div> </d=
iv><div>That is all.</div></div><div><br>=D3=D2=C5=C4=C1, 23 =CF=CB=D4=D1=
=C2=D2=D1 2013 =C7., 1:48:29 UTC+4 =D0=CF=CC=D8=DA=CF=D7=C1=D4=C5=CC=
=D8 Vlad from Moscow =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-left-style: solid=
;"><div dir=3D"ltr"><div>append should be considered as widening of the sem=
antic of push_back and nothing more.</div><div><br>=D3=D2=C5=C4=C1, 23 =CF=
=CB=D4=D1=C2=D2=D1 2013 =C7., 1:43:13 UTC+4 =D0=CF=CC=D8=DA=CF=D7=C1=
=D4=C5=CC=D8 Vlad from Moscow =CE=C1=D0=C9=D3=C1=CC:</div><blockquote class=
=3D"gmail_quote" style=3D"margin: 0px 0px 0px 0.8ex; padding-left: 1ex; bor=
der-left-color: rgb(204, 204, 204); border-left-width: 1px; border-left-sty=
le: solid;"><div dir=3D"ltr"><br>=D3=D2=C5=C4=C1, 23 =CF=CB=D4=D1=C2=D2=D1 =
2013 =C7., 1:30:52 UTC+4 =D0=CF=CC=D8=DA=CF=D7=C1=D4=C5=CC=D8 Evgeny P=
anasyuk =CE=C1=D0=C9=D3=C1=CC:<blockquote class=3D"gmail_quote" style=3D"ma=
rgin: 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; padd=
ing-left: 1ex; border-left-color: rgb(204, 204, 204); border-left-width: 1p=
x; border-left-style: solid;"><div dir=3D"ltr"><div>I do not like the idea =
that some non-member functions will be defined only for narrow groups of co=
ntainers. </div></div></blockquote><div><br>Some algorithms (non-member fun=
ction templates) are defined only for narrow groups of ranges.<br>There is =
nothing special in append case.<br></div><div> </div></div></blockquot=
e><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;"><div dir=3D"ltr"><div> </div><blockquot=
e class=3D"gmail_quote" style=3D"margin: 0px 0px 0px 0.8ex; padding-left: 1=
ex; border-left-color: rgb(204, 204, 204); border-left-width: 1px; border-l=
eft-style: solid;"><div dir=3D"ltr"><div>It will only confuse users. Beside=
s it will look strange that std::forward_list will be excluded fr=
om sequantial containers relative to this function.</div></div></block=
quote><div><br>There is no surprise - because it supports only part of Sequ=
ence container requirements - Table 100.<br>Moreover - there is no efficien=
t way to implement append for it.<br></div></div></blockquote><div> </=
div><div>In my opinion it will only confuse users. What about other no=
n-member functions that couldl be introduced and will deal with nerrow grou=
ps of containers? append is a property of few containers. It is what d=
istiguishes them from other containers.</div></div></blockquote></div></blo=
ckquote></div>
<p></p>
-- <br />
<br />
--- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals" 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_285_17219572.1382479076141--
.
Author: "Billy O'Neal" <billy.oneal@gmail.com>
Date: Tue, 22 Oct 2013 15:56:04 -0700
Raw View
--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>> 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'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"><<a href=3D"mailto:vlad.moscow@mail.ru" targ=
et=3D"_blank">vlad.moscow@mail.ru</a>></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"this" 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<int> append( const std::vector<int> &v1, const =
std::vector<int> &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'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'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'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"><<a>vlad....@ma=
il.ru</a>></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'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>>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 "append" implies modifying the original vector. Th=
ere's nothing about the syntactical difference between member and nomme=
mber functions which clearly indicates "this modifies" or "t=
his does not modify".</div>
<div><br></div><div>That is, there's no reason "v.append(xyz)"=
; doesn'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'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"><<a>vlad....@mail.ru</a>>=
</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 << 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 << 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'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's no append here=
-- append on basic_string is the same thing effectively as operator+=3D --=
but there's no such semantic operation that makes sense for vector.<di=
v>
<br>
</div><div>I suppose there's no reason for someone who wants this seman=
tic not to do:</div><div><br></div><div>template <typename T, typename I=
nputIterator></div><div>T& append(T& 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'=
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"><<a>vlad....@mail.ru</a>></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<int> 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 <=
< x << ' ';</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" 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" 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" 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" 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 />
<br />
--- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals" 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--
.
Author: Vlad from Moscow <vlad.moscow@mail.ru>
Date: Wed, 23 Oct 2013 02:59:23 -0700 (PDT)
Raw View
------=_Part_179_25904577.1382522363295
Content-Type: text/plain; charset=KOI8-R
Content-Transfer-Encoding: quoted-printable
To demonstrate the advantage of the method append let;s consider a simple=
=20
assignment.
Let;s assume that there are a vector of strings and three separate strings=
=20
that have to be appended to the vector.=20
=20
std::vector<std::string> v;
std::string s1 =3D "Dolce";
std::string s2 =3D " & ";
std::string s3 =3D "Gabbana";
=20
Having the method append we could write simply
=20
std:: cout << v.append( s1 ).append( s2 ).append( s3 );
=20
I intentially have written the expression in one line to demonstrate the=20
advantage of the method append.
=20
The result of the expression will be
=20
Dolce & Gabbana
=20
Now let;s substitute append for insert. We could write for example
=20
v.insert( v.insert( v.insert( v.end(), s1 ), s2 ), s3 );
=20
But how to output the result vector? We can not write simply
=20
std::cout << v.insert( v.insert( v.insert( v.end(), s1 ), s2 ), s3 );
=20
because the type of the method insert=20
is std::vector<std::string>::iterator. We even can not write the following=
=20
way
=20
std::cout << *v.insert( v.insert( v.insert( v.end(), s1 ), s2 ), s3 );
=20
because only one element of the vector will be displayed.
=20
Can we use std::copy? For example
=20
std::copy( v.insert( v.insert( v.insert( v.end(), s1 ), s2 ), s3 ),=20
v.end(),=20
std::ostream_iterator<std::string>( std::cout ) );
=20
No, we can not!=20
Because v.end() will be invalid iterator if it will be calculated before=20
the left operand.
=20
So we have only one possibility
=20
v.insert( v.insert( v.insert( v.end(), s1 ), s2 ), s3 );
std::cout << v;
=20
And we will get
=20
Gabbana & Dolce
=20
Compare the simple expression
=20
std:: cout << v.append( s1 ).append( s2 ).append( s3 );
=20
with the difficulties we had to overcome with insert. Moreover the=20
result does not coinside with the needed result.
=20
So the expression with insert must be rewritten. But we have now another=20
problem. The expression can not be written in one line the same way as the=
=20
expression with append. So the only way is to write
=20
v.insert( v.cend(), s1 );
v.insert( v.cend(), s2 );
v.insert( v.cend(), s3 );
=20
std::cout << v;
=20
We had to use three times v.cend(). It is totally useless information=20
because our intention was clear enough: we wanted to append strings. It is=
=20
obvious without using v.cend() each time that we want to append a new=20
string at the end of the vector.
Method append() expresses this intention very clear without any superfluous=
=20
parameter that we need each time duplicate if we are going to use insert.
=20
So method append *appends* method push_back when a range of new data is=20
used the same way as method insert with ranges appends method insert with=
=20
one inserted data.
=D3=D2=C5=C4=C1, 23 =CF=CB=D4=D1=C2=D2=D1 2013 =C7., 1:57:56 UTC+4 =D0=CF=
=CC=D8=DA=CF=D7=C1=D4=C5=CC=D8 Vlad from Moscow=20
=CE=C1=D0=C9=D3=C1=CC:
> append should be considered as widening of the semantic of push_back and=
=20
> nothing more. For example in class std::vector there is method insert tha=
t=20
> allows to insert one element
> =20
>
> iterator insert(const_iterator position, const T& x);
> is not there?
> =20
> At the same time insert allows to insert several elemnts
> =20
>
> iterator insert(const_iterator position, size_type n, const T& x);
>
> template <class InputIterator>
>
> iterator insert(const_iterator position,
>
> InputIterator first, InputIterator last);
>
> iterator insert(const_iterator position, initializer_list<T> il);
> The same must be valid with push_back. It allows to append one=20
> element. What I want that it also would allow to append several elements =
as=20
> insert does. Only push_back will be used through its alias append when=20
> several elements are needed to append.
> =20
> That is all.
>
> =D3=D2=C5=C4=C1, 23 =CF=CB=D4=D1=C2=D2=D1 2013 =C7., 1:48:29 UTC+4 =D0=CF=
=CC=D8=DA=CF=D7=C1=D4=C5=CC=D8 Vlad from Moscow=20
> =CE=C1=D0=C9=D3=C1=CC:
>
>> append should be considered as widening of the semantic of push_back and=
=20
>> nothing more.
>>
>> =D3=D2=C5=C4=C1, 23 =CF=CB=D4=D1=C2=D2=D1 2013 =C7., 1:43:13 UTC+4 =D0=
=CF=CC=D8=DA=CF=D7=C1=D4=C5=CC=D8 Vlad from Moscow=20
>> =CE=C1=D0=C9=D3=C1=CC:
>>
>>>
>>> =D3=D2=C5=C4=C1, 23 =CF=CB=D4=D1=C2=D2=D1 2013 =C7., 1:30:52 UTC+4 =D0=
=CF=CC=D8=DA=CF=D7=C1=D4=C5=CC=D8 Evgeny Panasyuk=20
>>> =CE=C1=D0=C9=D3=C1=CC:
>>>>
>>>> I do not like the idea that some non-member functions will be defined=
=20
>>>>> only for narrow groups of containers.=20
>>>>>
>>>>
>>>> Some algorithms (non-member function templates) are defined only for=
=20
>>>> narrow groups of ranges.
>>>> There is nothing special in append case.
>>>> =20
>>>>
>>> =20
>>>>
>>>>> It will only confuse users. Besides it will look strange that=20
>>>>> std::forward_list will be excluded from sequantial containers relativ=
e to=20
>>>>> this function.
>>>>>
>>>>
>>>> There is no surprise - because it supports only part of Sequence=20
>>>> container requirements - Table 100.
>>>> Moreover - there is no efficient way to implement append for it.
>>>>
>>> =20
>>> In my opinion it will only confuse users. What about other non-member=
=20
>>> functions that couldl be introduced and will deal with nerrow groups of=
=20
>>> containers? append is a property of few containers. It is what distigui=
shes=20
>>> them from other containers.
>>>
>>
--=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_179_25904577.1382522363295
Content-Type: text/html; charset=KOI8-R
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr"><div>To demonstrate the advantage of the method append let=
;s consider a simple assignment.</div><div>Let;s assume that there are a ve=
ctor of strings and three separate strings that have to be appended to the =
vector. </div><div> </div><div>std::vector<std::string> v;</div>=
<div>std::string s1 =3D "Dolce";</div><div>std::string s2 =3D " & ";</d=
iv><div>std::string s3 =3D "Gabbana";</div><div> </div><div>Having the=
method append we could write simply</div><div> </div><div>std:: cout =
<< v.append( s1 ).append( s2 ).append( s3 );</div><div> </div><d=
iv>I intentially have written the expression in one line to demon=
strate the advantage of the method append.</div><div> </div><div>The r=
esult of the expression will be</div><div> </div><div>Dolce & Gabb=
ana</div><div> </div><div>Now let;s substitute append for insert. We c=
ould write for example</div><div> </div><div>v.insert( v.insert( v.ins=
ert( v.end(), s1 ), s2 ), s3 );</div><div> </div><div>But how to outpu=
t the result vector? We can not write simply</div><div> </div><div><di=
v>std::cout << v.insert( v.insert( v.insert( v.end(), s1 ), s2 ), s3 =
);</div><div> </div><div>because the type of the method insert is=
std::vector<std::string>::iterator. We even can not write the f=
ollowing way</div><div> </div><div><div>std::cout << *v.insert( =
v.insert( v.insert( v.end(), s1 ), s2 ), s3 );</div><div> </div><div>b=
ecause only one element of the vector will be displayed.</div><div> </=
div><div>Can we use std::copy? For example</div><div> </div><div>std::=
copy( v.insert( v.insert( v.insert( v.end(), s1 ), s2 ), s3 ), v.end(), </d=
iv><div> &=
nbsp; std::ostream_iterator<std::string>( std::cout=
) );</div><div> </div><div>No, we can not! </div><div>Because v.end()=
will be invalid iterator if it will be calculated before the left operand.=
</div><div> </div><div>So we have only one possibility</div><div> =
;</div><div>v.insert( v.insert( v.insert( v.end(), s1 ), s2 ), s3 );</div><=
div>std::cout << v;</div><div> </div></div></div><div>And we wil=
l get</div><div> </div><div>Gabbana & Dolce</div><div> </div>=
<div>Compare the simple expression</div><div> </div><div>std:: cout &l=
t;< v.append( s1 ).append( s2 ).append( s3 );</div><div> </div><div=
>with the difficulties we had to overcome with insert. Moreover the result&=
nbsp;does not coinside with the needed result.</div><div> </div><div>S=
o the expression with insert must be rewritten. But we have now another pro=
blem. The expression can not be written in one line the same way as the exp=
ression with append. So the only way is to write</div><div> </div=
><div>v.insert( v.cend(), s1 );</div><div>v.insert( v.cend(), s2 );</div><d=
iv>v.insert( v.cend(), s3 );</div><div> </div><div>std::cout << =
v;</div><div> </div><div>We had to use three times v.cend(). It is tot=
ally useless information because our intention was clear enough: we wanted =
to append strings. It is obvious without using v.cend() each time that we w=
ant to append a new string at the end of the vector.</div><div>Method appen=
d() expresses this intention very clear without any superfluous parameter t=
hat we need each time duplicate if we are going to use insert.</div><div>&n=
bsp;</div><div>So method append *appends* method push_back when a range of =
new data is used the same way as method insert with ranges appends method i=
nsert with one inserted data.</div><div><br>=D3=D2=C5=C4=C1, 23 =CF=CB=D4=
=D1=C2=D2=D1 2013 =C7., 1:57:56 UTC+4 =D0=CF=CC=D8=DA=CF=D7=C1=D4=C5=
=CC=D8 Vlad from Moscow =CE=C1=D0=C9=D3=C1=CC:</div><blockquote class=3D"gm=
ail_quote" style=3D"margin: 0px 0px 0px 0.8ex; padding-left: 1ex; border-le=
ft-color: rgb(204, 204, 204); border-left-width: 1px; border-left-style: so=
lid;"><div dir=3D"ltr"><div><div>append should be considered as widening of=
the semantic of push_back and nothing more. For example in class std::vect=
or there is method insert that allows to insert one element</div><div> =
;</div><font face=3D"LMMono9-Regular" size=3D"1"><font face=3D"LMMono9-Regu=
lar" size=3D"1"><p>iterator insert(const_iterator position, const T& x)=
;</p><div></div></font><div></div></font><div>is not there?</div><div> =
;</div><div>At the same time insert allows to insert several elemnts</div><=
div> </div><div><font face=3D"LMMono9-Regular" size=3D"1"><font face=
=3D"LMMono9-Regular" size=3D"1"><p align=3D"LEFT">iterator insert(const_ite=
rator position, size_type n, const T& x);</p>
<p align=3D"LEFT">template <class InputIterator></p>
<p align=3D"LEFT">iterator insert(const_iterator position,</p>
<p align=3D"LEFT">InputIterator first, InputIterator last);</p>
<p>iterator insert(const_iterator position, initializer_list<T> il);<=
/p></font></font>The same must be valid with push_back. It allows to a=
ppend one element. What I want that it also would allow to append seve=
ral elements as insert does. Only push_back will be used through its a=
lias append when several elements are needed to append.</div><div> </d=
iv><div>That is all.</div></div><div><br>=D3=D2=C5=C4=C1, 23 =CF=CB=D4=D1=
=C2=D2=D1 2013 =C7., 1:48:29 UTC+4 =D0=CF=CC=D8=DA=CF=D7=C1=D4=C5=CC=
=D8 Vlad from Moscow =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-left-style: solid=
;"><div dir=3D"ltr"><div>append should be considered as widening of the sem=
antic of push_back and nothing more.</div><div><br>=D3=D2=C5=C4=C1, 23 =CF=
=CB=D4=D1=C2=D2=D1 2013 =C7., 1:43:13 UTC+4 =D0=CF=CC=D8=DA=CF=D7=C1=
=D4=C5=CC=D8 Vlad from Moscow =CE=C1=D0=C9=D3=C1=CC:</div><blockquote class=
=3D"gmail_quote" style=3D"margin: 0px 0px 0px 0.8ex; padding-left: 1ex; bor=
der-left-color: rgb(204, 204, 204); border-left-width: 1px; border-left-sty=
le: solid;"><div dir=3D"ltr"><br>=D3=D2=C5=C4=C1, 23 =CF=CB=D4=D1=C2=D2=D1 =
2013 =C7., 1:30:52 UTC+4 =D0=CF=CC=D8=DA=CF=D7=C1=D4=C5=CC=D8 Evgeny P=
anasyuk =CE=C1=D0=C9=D3=C1=CC:<blockquote class=3D"gmail_quote" style=3D"ma=
rgin: 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; padd=
ing-left: 1ex; border-left-color: rgb(204, 204, 204); border-left-width: 1p=
x; border-left-style: solid;"><div dir=3D"ltr"><div>I do not like the idea =
that some non-member functions will be defined only for narrow groups of co=
ntainers. </div></div></blockquote><div><br>Some algorithms (non-member fun=
ction templates) are defined only for narrow groups of ranges.<br>There is =
nothing special in append case.<br></div><div> </div></div></blockquot=
e><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;"><div dir=3D"ltr"><div> </div><blockquot=
e class=3D"gmail_quote" style=3D"margin: 0px 0px 0px 0.8ex; padding-left: 1=
ex; border-left-color: rgb(204, 204, 204); border-left-width: 1px; border-l=
eft-style: solid;"><div dir=3D"ltr"><div>It will only confuse users. Beside=
s it will look strange that std::forward_list will be excluded fr=
om sequantial containers relative to this function.</div></div></block=
quote><div><br>There is no surprise - because it supports only part of Sequ=
ence container requirements - Table 100.<br>Moreover - there is no efficien=
t way to implement append for it.<br></div></div></blockquote><div> </=
div><div>In my opinion it will only confuse users. What about other no=
n-member functions that couldl be introduced and will deal with nerrow grou=
ps of containers? append is a property of few containers. It is what d=
istiguishes them from other containers.</div></div></blockquote></div></blo=
ckquote></div></blockquote></div>
<p></p>
-- <br />
<br />
--- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals" 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_179_25904577.1382522363295--
.
Author: Vlad from Moscow <vlad.moscow@mail.ru>
Date: Wed, 23 Oct 2013 03:11:52 -0700 (PDT)
Raw View
------=_Part_3001_18025379.1382523112804
Content-Type: text/plain; charset=KOI8-R
Content-Transfer-Encoding: quoted-printable
I am sorry. I made a mistake. To output the vector I should use the=20
range-based for llop. I simply thought about std::basic_string when I were=
=20
writing about the vector.
=20
So the expression will be written as
=20
for ( std:;string s : v.append( s1 ).append( s2 ).append( s3 ) ) std::cout=
=20
<< s;
=20
Also I would like to point out that if I wanted to substitute the vector=20
for std::basic_string nothing would be changed!
=20
std::string s;
=20
std::cout << s.append( s1 ).append( s2 ).append( s3 ) );
=20
=D3=D2=C5=C4=C1, 23 =CF=CB=D4=D1=C2=D2=D1 2013 =C7., 13:59:23 UTC+4 =D0=CF=
=CC=D8=DA=CF=D7=C1=D4=C5=CC=D8 Vlad from Moscow=20
=CE=C1=D0=C9=D3=C1=CC:
> To demonstrate the advantage of the method append let;s consider a simple=
=20
> assignment.
> Let;s assume that there are a vector of strings and three separate string=
s=20
> that have to be appended to the vector.=20
> =20
> std::vector<std::string> v;
> std::string s1 =3D "Dolce";
> std::string s2 =3D " & ";
> std::string s3 =3D "Gabbana";
> =20
> Having the method append we could write simply
> =20
> std:: cout << v.append( s1 ).append( s2 ).append( s3 );
> =20
> I intentially have written the expression in one line to demonstrate the=
=20
> advantage of the method append.
> =20
> The result of the expression will be
> =20
> Dolce & Gabbana
> =20
> Now let;s substitute append for insert. We could write for example
> =20
> v.insert( v.insert( v.insert( v.end(), s1 ), s2 ), s3 );
> =20
> But how to output the result vector? We can not write simply
> =20
> std::cout << v.insert( v.insert( v.insert( v.end(), s1 ), s2 ), s3 );
> =20
> because the type of the method insert=20
> is std::vector<std::string>::iterator. We even can not write the followin=
g=20
> way
> =20
> std::cout << *v.insert( v.insert( v.insert( v.end(), s1 ), s2 ), s3 );
> =20
> because only one element of the vector will be displayed.
> =20
> Can we use std::copy? For example
> =20
> std::copy( v.insert( v.insert( v.insert( v.end(), s1 ), s2 ), s3 ),=20
> v.end(),=20
> std::ostream_iterator<std::string>( std::cout ) );
> =20
> No, we can not!=20
> Because v.end() will be invalid iterator if it will be calculated before=
=20
> the left operand.
> =20
> So we have only one possibility
> =20
> v.insert( v.insert( v.insert( v.end(), s1 ), s2 ), s3 );
> std::cout << v;
> =20
> And we will get
> =20
> Gabbana & Dolce
> =20
> Compare the simple expression
> =20
> std:: cout << v.append( s1 ).append( s2 ).append( s3 );
> =20
> with the difficulties we had to overcome with insert. Moreover the=20
> result does not coinside with the needed result.
> =20
> So the expression with insert must be rewritten. But we have now another=
=20
> problem. The expression can not be written in one line the same way as th=
e=20
> expression with append. So the only way is to write
> =20
> v.insert( v.cend(), s1 );
> v.insert( v.cend(), s2 );
> v.insert( v.cend(), s3 );
> =20
> std::cout << v;
> =20
> We had to use three times v.cend(). It is totally useless information=20
> because our intention was clear enough: we wanted to append strings. It i=
s=20
> obvious without using v.cend() each time that we want to append a new=20
> string at the end of the vector.
> Method append() expresses this intention very clear without any=20
> superfluous parameter that we need each time duplicate if we are going to=
=20
> use insert.
> =20
> So method append *appends* method push_back when a range of new data is=
=20
> used the same way as method insert with ranges appends method insert with=
=20
> one inserted data.
>
> =D3=D2=C5=C4=C1, 23 =CF=CB=D4=D1=C2=D2=D1 2013 =C7., 1:57:56 UTC+4 =D0=CF=
=CC=D8=DA=CF=D7=C1=D4=C5=CC=D8 Vlad from Moscow=20
> =CE=C1=D0=C9=D3=C1=CC:
>
>> append should be considered as widening of the semantic of push_back and=
=20
>> nothing more. For example in class std::vector there is method insert th=
at=20
>> allows to insert one element
>> =20
>>
>> iterator insert(const_iterator position, const T& x);
>> is not there?
>> =20
>> At the same time insert allows to insert several elemnts
>> =20
>>
>> iterator insert(const_iterator position, size_type n, const T& x);
>>
>> template <class InputIterator>
>>
>> iterator insert(const_iterator position,
>>
>> InputIterator first, InputIterator last);
>>
>> iterator insert(const_iterator position, initializer_list<T> il);
>> The same must be valid with push_back. It allows to append one=20
>> element. What I want that it also would allow to append several elements=
as=20
>> insert does. Only push_back will be used through its alias append when=
=20
>> several elements are needed to append.
>> =20
>> That is all.
>>
>> =D3=D2=C5=C4=C1, 23 =CF=CB=D4=D1=C2=D2=D1 2013 =C7., 1:48:29 UTC+4 =D0=
=CF=CC=D8=DA=CF=D7=C1=D4=C5=CC=D8 Vlad from Moscow=20
>> =CE=C1=D0=C9=D3=C1=CC:
>>
>>> append should be considered as widening of the semantic of push_back an=
d=20
>>> nothing more.
>>>
>>> =D3=D2=C5=C4=C1, 23 =CF=CB=D4=D1=C2=D2=D1 2013 =C7., 1:43:13 UTC+4 =D0=
=CF=CC=D8=DA=CF=D7=C1=D4=C5=CC=D8 Vlad from Moscow=20
>>> =CE=C1=D0=C9=D3=C1=CC:
>>>
>>>>
>>>> =D3=D2=C5=C4=C1, 23 =CF=CB=D4=D1=C2=D2=D1 2013 =C7., 1:30:52 UTC+4 =D0=
=CF=CC=D8=DA=CF=D7=C1=D4=C5=CC=D8 Evgeny Panasyuk=20
>>>> =CE=C1=D0=C9=D3=C1=CC:
>>>>>
>>>>> I do not like the idea that some non-member functions will be defined=
=20
>>>>>> only for narrow groups of containers.=20
>>>>>>
>>>>>
>>>>> Some algorithms (non-member function templates) are defined only for=
=20
>>>>> narrow groups of ranges.
>>>>> There is nothing special in append case.
>>>>> =20
>>>>>
>>>> =20
>>>>>
>>>>>> It will only confuse users. Besides it will look strange that=20
>>>>>> std::forward_list will be excluded from sequantial containers relati=
ve to=20
>>>>>> this function.
>>>>>>
>>>>>
>>>>> There is no surprise - because it supports only part of Sequence=20
>>>>> container requirements - Table 100.
>>>>> Moreover - there is no efficient way to implement append for it.
>>>>>
>>>> =20
>>>> In my opinion it will only confuse users. What about other non-member=
=20
>>>> functions that couldl be introduced and will deal with nerrow groups o=
f=20
>>>> containers? append is a property of few containers. It is what distigu=
ishes=20
>>>> them from other containers.
>>>>
>>>
--=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_3001_18025379.1382523112804
Content-Type: text/html; charset=KOI8-R
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr"><div>I am sorry. I made a mistake. To output the vector I =
should use the range-based for llop. I simply thought about std::basic_stri=
ng when I were writing about the vector.</div><div> </div><div>So the =
expression will be written as</div><div> </div><div>for ( std:;string =
s : v.append( s1 ).append( s2 ).append( s3 ) ) std::cout << s;<=
/div><div> </div><div>Also I would like to point out that if I wanted =
to substitute the vector for std::basic_string nothing would be changed!</d=
iv><div> </div><div>std::string s;</div><div> </div><div><div>std=
::cout << s.append( s1 ).append( s2 ).append( s3 ) );</div><div>=
</div></div><div><br>=D3=D2=C5=C4=C1, 23 =CF=CB=D4=D1=C2=D2=D1 2013&n=
bsp;=C7., 13:59:23 UTC+4 =D0=CF=CC=D8=DA=CF=D7=C1=D4=C5=CC=D8 Vlad from Mos=
cow =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, 2=
04, 204); border-left-width: 1px; border-left-style: solid;"><div dir=3D"lt=
r"><div>To demonstrate the advantage of the method append let;s consider a =
simple assignment.</div><div>Let;s assume that there are a vector of string=
s and three separate strings that have to be appended to the vector. </div>=
<div> </div><div>std::vector<std::string> v;</div><div>std::stri=
ng s1 =3D "Dolce";</div><div>std::string s2 =3D " & ";</div><div>std::s=
tring s3 =3D "Gabbana";</div><div> </div><div>Having the method append=
we could write simply</div><div> </div><div>std:: cout << v.app=
end( s1 ).append( s2 ).append( s3 );</div><div> </div><div>I intential=
ly have written the expression in one line to demonstrate the adv=
antage of the method append.</div><div> </div><div>The result of the e=
xpression will be</div><div> </div><div>Dolce & Gabbana</div><div>=
</div><div>Now let;s substitute append for insert. We could write for=
example</div><div> </div><div>v.insert( v.insert( v.insert( v.end(), =
s1 ), s2 ), s3 );</div><div> </div><div>But how to output the result v=
ector? We can not write simply</div><div> </div><div><div>std::cout &l=
t;< v.insert( v.insert( v.insert( v.end(), s1 ), s2 ), s3 );</div><div>&=
nbsp;</div><div>because the type of the method insert is std::vec=
tor<std::string>::<wbr>iterator. We even can not write the following =
way</div><div> </div><div><div>std::cout << *v.insert( v.insert(=
v.insert( v.end(), s1 ), s2 ), s3 );</div><div> </div><div>because on=
ly one element of the vector will be displayed.</div><div> </div><div>=
Can we use std::copy? For example</div><div> </div><div>std::copy( v.i=
nsert( v.insert( v.insert( v.end(), s1 ), s2 ), s3 ), v.end(), </div><div>&=
nbsp; &nbs=
p; std::ostream_iterator<std::<wbr>string>( std::cout ) )=
;</div><div> </div><div>No, we can not! </div><div>Because v.end() wil=
l be invalid iterator if it will be calculated before the left operand.</di=
v><div> </div><div>So we have only one possibility</div><div> </d=
iv><div>v.insert( v.insert( v.insert( v.end(), s1 ), s2 ), s3 );</div><div>=
std::cout << v;</div><div> </div></div></div><div>And we will ge=
t</div><div> </div><div>Gabbana & Dolce</div><div> </div><div=
>Compare the simple expression</div><div> </div><div>std:: cout <&l=
t; v.append( s1 ).append( s2 ).append( s3 );</div><div> </div><div>wit=
h the difficulties we had to overcome with insert. Moreover the result =
;does not coinside with the needed result.</div><div> </div><div>So th=
e expression with insert must be rewritten. But we have now another problem=
.. The expression can not be written in one line the same way as the express=
ion with append. So the only way is to write</div><div> </div><di=
v>v.insert( v.cend(), s1 );</div><div>v.insert( v.cend(), s2 );</div><div>v=
..insert( v.cend(), s3 );</div><div> </div><div>std::cout << v;</=
div><div> </div><div>We had to use three times v.cend(). It is totally=
useless information because our intention was clear enough: we wanted to a=
ppend strings. It is obvious without using v.cend() each time that we want =
to append a new string at the end of the vector.</div><div>Method append() =
expresses this intention very clear without any superfluous parameter that =
we need each time duplicate if we are going to use insert.</div><div> =
</div><div>So method append *appends* method push_back when a range of new =
data is used the same way as method insert with ranges appends method inser=
t with one inserted data.</div><div><br>=D3=D2=C5=C4=C1, 23 =CF=CB=D4=D1=C2=
=D2=D1 2013 =C7., 1:57:56 UTC+4 =D0=CF=CC=D8=DA=CF=D7=C1=D4=C5=CC=D8 V=
lad from Moscow =CE=C1=D0=C9=D3=C1=CC:</div><blockquote class=3D"gmail_quot=
e" 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;"><d=
iv dir=3D"ltr"><div><div>append should be considered as widening of the sem=
antic of push_back and nothing more. For example in class std::vector there=
is method insert that allows to insert one element</div><div> </div><=
font face=3D"LMMono9-Regular" size=3D"1"><font face=3D"LMMono9-Regular" siz=
e=3D"1"><p>iterator insert(const_iterator position, const T& x);</p><di=
v></div></font><div></div></font><div>is not there?</div><div> </div><=
div>At the same time insert allows to insert several elemnts</div><div>&nbs=
p;</div><div><font face=3D"LMMono9-Regular" size=3D"1"><font face=3D"LMMono=
9-Regular" size=3D"1"><p align=3D"LEFT">iterator insert(const_iterator posi=
tion, size_type n, const T& x);</p>
<p align=3D"LEFT">template <class InputIterator></p>
<p align=3D"LEFT">iterator insert(const_iterator position,</p>
<p align=3D"LEFT">InputIterator first, InputIterator last);</p>
<p>iterator insert(const_iterator position, initializer_list<T> il);<=
/p></font></font>The same must be valid with push_back. It allows to a=
ppend one element. What I want that it also would allow to append seve=
ral elements as insert does. Only push_back will be used through its a=
lias append when several elements are needed to append.</div><div> </d=
iv><div>That is all.</div></div><div><br>=D3=D2=C5=C4=C1, 23 =CF=CB=D4=D1=
=C2=D2=D1 2013 =C7., 1:48:29 UTC+4 =D0=CF=CC=D8=DA=CF=D7=C1=D4=C5=CC=
=D8 Vlad from Moscow =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-left-style: solid=
;"><div dir=3D"ltr"><div>append should be considered as widening of the sem=
antic of push_back and nothing more.</div><div><br>=D3=D2=C5=C4=C1, 23 =CF=
=CB=D4=D1=C2=D2=D1 2013 =C7., 1:43:13 UTC+4 =D0=CF=CC=D8=DA=CF=D7=C1=
=D4=C5=CC=D8 Vlad from Moscow =CE=C1=D0=C9=D3=C1=CC:</div><blockquote class=
=3D"gmail_quote" style=3D"margin: 0px 0px 0px 0.8ex; padding-left: 1ex; bor=
der-left-color: rgb(204, 204, 204); border-left-width: 1px; border-left-sty=
le: solid;"><div dir=3D"ltr"><br>=D3=D2=C5=C4=C1, 23 =CF=CB=D4=D1=C2=D2=D1 =
2013 =C7., 1:30:52 UTC+4 =D0=CF=CC=D8=DA=CF=D7=C1=D4=C5=CC=D8 Evgeny P=
anasyuk =CE=C1=D0=C9=D3=C1=CC:<blockquote class=3D"gmail_quote" style=3D"ma=
rgin: 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; padd=
ing-left: 1ex; border-left-color: rgb(204, 204, 204); border-left-width: 1p=
x; border-left-style: solid;"><div dir=3D"ltr"><div>I do not like the idea =
that some non-member functions will be defined only for narrow groups of co=
ntainers. </div></div></blockquote><div><br>Some algorithms (non-member fun=
ction templates) are defined only for narrow groups of ranges.<br>There is =
nothing special in append case.<br></div><div> </div></div></blockquot=
e><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;"><div dir=3D"ltr"><div> </div><blockquot=
e class=3D"gmail_quote" style=3D"margin: 0px 0px 0px 0.8ex; padding-left: 1=
ex; border-left-color: rgb(204, 204, 204); border-left-width: 1px; border-l=
eft-style: solid;"><div dir=3D"ltr"><div>It will only confuse users. Beside=
s it will look strange that std::forward_list will be excluded fr=
om sequantial containers relative to this function.</div></div></block=
quote><div><br>There is no surprise - because it supports only part of Sequ=
ence container requirements - Table 100.<br>Moreover - there is no efficien=
t way to implement append for it.<br></div></div></blockquote><div> </=
div><div>In my opinion it will only confuse users. What about other no=
n-member functions that couldl be introduced and will deal with nerrow grou=
ps of containers? append is a property of few containers. It is what d=
istiguishes them from other containers.</div></div></blockquote></div></blo=
ckquote></div></blockquote></div></blockquote></div>
<p></p>
-- <br />
<br />
--- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals" 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_3001_18025379.1382523112804--
.
Author: Ville Voutilainen <ville.voutilainen@gmail.com>
Date: Wed, 23 Oct 2013 14:08:43 +0300
Raw View
--047d7bdc9c525a94da04e9668af5
Content-Type: text/plain; charset=ISO-8859-1
On 23 October 2013 12:59, Vlad from Moscow <vlad.moscow@mail.ru> wrote:
>
>
> So we have only one possibility
>
> v.insert( v.insert( v.insert( v.end(), s1 ), s2 ), s3 );
> std::cout << v;
>
That's not the only possibility, you can wrap the operation in a lambda and
output the result of the lambda invocation.
--
---
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/.
--047d7bdc9c525a94da04e9668af5
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr"><br><div class=3D"gmail_extra"><br><br><div class=3D"gmail=
_quote">On 23 October 2013 12:59, Vlad from Moscow <span dir=3D"ltr"><<a=
href=3D"mailto:vlad.moscow@mail.ru" target=3D"_blank">vlad.moscow@mail.ru<=
/a>></span> wrote:<br>
<blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1p=
x #ccc solid;padding-left:1ex"><div dir=3D"ltr"><br>=A0<div><div><div>So we=
have only one possibility</div><div>=A0</div><div>v.insert( v.insert( v.in=
sert( v.end(), s1 ), s2 ), s3 );</div>
<div>std::cout << v;</div><div></div></div></div></div></blockquote><=
div><br></div><div>That's not the only possibility, you can wrap the op=
eration in a lambda and<br></div><div>output the result of the lambda invoc=
ation.<br>
<br></div></div><br></div></div>
<p></p>
-- <br />
<br />
--- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals" 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 />
--047d7bdc9c525a94da04e9668af5--
.
Author: Vlad from Moscow <vlad.moscow@mail.ru>
Date: Wed, 23 Oct 2013 04:44:50 -0700 (PDT)
Raw View
------=_Part_24_13929303.1382528690103
Content-Type: text/plain; charset=KOI8-R
Content-Transfer-Encoding: quoted-printable
Yes, you can. But it will not look very well taking into account a possible=
=20
interchangeability with std::basic_string. It only makes the code more=20
compound and less intuitivily clear.
=20
For example if there is a function declared as
=20
std:;vector<std:;string> & f( std::vector<std:;string> & );
=20
it will be more readable and clear to call it as
=20
std::vector<std::string> v( 1, "Hello " );
f( v.append( "World" ) );
=20
than to use a lambda expression as the argument.
=20
=D3=D2=C5=C4=C1, 23 =CF=CB=D4=D1=C2=D2=D1 2013 =C7., 15:08:43 UTC+4 =D0=CF=
=CC=D8=DA=CF=D7=C1=D4=C5=CC=D8 Ville Voutilainen=20
=CE=C1=D0=C9=D3=C1=CC:
>
>
>
> On 23 October 2013 12:59, Vlad from Moscow <vlad....@mail.ru <javascript:=
>
> > wrote:
>
>>
>> =20
>> So we have only one possibility
>> =20
>> v.insert( v.insert( v.insert( v.end(), s1 ), s2 ), s3 );
>> std::cout << v;
>>
>
> That's not the only possibility, you can wrap the operation in a lambda a=
nd
> output the result of the lambda invocation.
>
>
>
--=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_24_13929303.1382528690103
Content-Type: text/html; charset=KOI8-R
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr"><div>Yes, you can. But it will not look very well tak=
ing into account a possible interchangeability with std::basic_string. It o=
nly makes the code more compound and less intuitivily clear.</div><div>&nbs=
p;</div><div>For example if there is a function declared as</div><div> =
;</div><div>std:;vector<std:;string> & f( std::vector<std:;str=
ing> & );</div><div> </div><div>it will be more readable a=
nd clear to call it as</div><div> </div><div>std::vector<std::strin=
g> v( 1, "Hello " );</div><div>f( v.append( "World" ) );</div><div> =
;</div><div>than to use a lambda expression as the argument.</div><div>&nbs=
p;</div><div><br>=D3=D2=C5=C4=C1, 23 =CF=CB=D4=D1=C2=D2=D1 2013 =C7., =
15:08:43 UTC+4 =D0=CF=CC=D8=DA=CF=D7=C1=D4=C5=CC=D8 Ville Voutilainen =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-left-style: solid;"><div dir=3D"ltr"><br>=
<div><br><br><div class=3D"gmail_quote">On 23 October 2013 12:59, Vlad from=
Moscow <span dir=3D"ltr"><<a href=3D"javascript:" target=3D"_blank" gdf=
-obfuscated-mailto=3D"Y791NlW5XfYJ">vlad....@mail.ru</a>></span> wrote:<=
br>
<blockquote class=3D"gmail_quote" style=3D"margin: 0px 0px 0px 0.8ex; paddi=
ng-left: 1ex; border-left-color: rgb(204, 204, 204); border-left-width: 1px=
; border-left-style: solid;"><div dir=3D"ltr"><br> <div><div><div>So w=
e have only one possibility</div><div> </div><div>v.insert( v.insert( =
v.insert( v.end(), s1 ), s2 ), s3 );</div>
<div>std::cout << v;</div><div></div></div></div></div></blockquote><=
div><br></div><div>That's not the only possibility, you can wrap the operat=
ion in a lambda and<br></div><div>output the result of the lambda invocatio=
n.<br>
<br></div></div><br></div></div>
</blockquote></div>
<p></p>
-- <br />
<br />
--- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals" 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_24_13929303.1382528690103--
.
Author: Vlad from Moscow <vlad.moscow@mail.ru>
Date: Wed, 23 Oct 2013 04:48:32 -0700 (PDT)
Raw View
------=_Part_204_12897971.1382528912248
Content-Type: text/plain; charset=KOI8-R
Content-Transfer-Encoding: quoted-printable
Or even as
=20
std::vector<std::string> v( 1, "Hello " );
f( v.append( { "World ", "Let ", "use ", "method ", "append!" } ) );
=D3=D2=C5=C4=C1, 23 =CF=CB=D4=D1=C2=D2=D1 2013 =C7., 15:44:50 UTC+4 =D0=CF=
=CC=D8=DA=CF=D7=C1=D4=C5=CC=D8 Vlad from Moscow=20
=CE=C1=D0=C9=D3=C1=CC:
> Yes, you can. But it will not look very well taking into account a=20
> possible interchangeability with std::basic_string. It only makes the cod=
e=20
> more compound and less intuitivily clear.
> =20
> For example if there is a function declared as
> =20
> std:;vector<std:;string> & f( std::vector<std:;string> & );
> =20
> it will be more readable and clear to call it as
> =20
> std::vector<std::string> v( 1, "Hello " );
> f( v.append( "World" ) );
> =20
> than to use a lambda expression as the argument.
> =20
>
> =D3=D2=C5=C4=C1, 23 =CF=CB=D4=D1=C2=D2=D1 2013 =C7., 15:08:43 UTC+4 =D0=
=CF=CC=D8=DA=CF=D7=C1=D4=C5=CC=D8 Ville Voutilainen=20
> =CE=C1=D0=C9=D3=C1=CC:
>
>>
>>
>>
>> On 23 October 2013 12:59, Vlad from Moscow <vlad....@mail.ru> wrote:
>>
>>>
>>> =20
>>> So we have only one possibility
>>> =20
>>> v.insert( v.insert( v.insert( v.end(), s1 ), s2 ), s3 );
>>> std::cout << v;
>>>
>>
>> That's not the only possibility, you can wrap the operation in a lambda=
=20
>> and
>> output the result of the lambda invocation.
>>
>>
>>
--=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_204_12897971.1382528912248
Content-Type: text/html; charset=KOI8-R
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr"><div>Or even as</div><div> </div><div><div>std::vecto=
r<std::string> v( 1, "Hello " );</div><div>f( v.append( { "World ", "=
Let ", "use ", "method ", "append!" } ) );</div><br>=D3=D2=C5=C4=C1, 2=
3 =CF=CB=D4=D1=C2=D2=D1 2013 =C7., 15:44:50 UTC+4 =D0=CF=CC=D8=DA=CF=
=D7=C1=D4=C5=CC=D8 Vlad from Moscow =CE=C1=D0=C9=D3=C1=CC:</div><blockquote=
class=3D"gmail_quote" style=3D"margin: 0px 0px 0px 0.8ex; padding-left: 1e=
x; border-left-color: rgb(204, 204, 204); border-left-width: 1px; border-le=
ft-style: solid;"><div dir=3D"ltr"><div>Yes, you can. But it will not look =
very well taking into account a possible interchangeability with std::=
basic_string. It only makes the code more compound and less intuitivily cle=
ar.</div><div> </div><div>For example if there is a function declared =
as</div><div> </div><div>std:;vector<std:;string> & f( std::=
vector<std:;string> & );</div><div> </div><div>it will =
be more readable and clear to call it as</div><div> </div><div>std::ve=
ctor<std::string> v( 1, "Hello " );</div><div>f( v.append( "World" ) =
);</div><div> </div><div>than to use a lambda expression as the argume=
nt.</div><div> </div><div><br>=D3=D2=C5=C4=C1, 23 =CF=CB=D4=D1=C2=D2=
=D1 2013 =C7., 15:08:43 UTC+4 =D0=CF=CC=D8=DA=CF=D7=C1=D4=C5=CC=D8 Vil=
le Voutilainen =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-left-style: solid;"><di=
v dir=3D"ltr"><br><div><br><br><div class=3D"gmail_quote">On 23 October 201=
3 12:59, Vlad from Moscow <span dir=3D"ltr"><<a>vlad....@mail.ru</a>>=
</span> wrote:<br>
<blockquote class=3D"gmail_quote" style=3D"margin: 0px 0px 0px 0.8ex; paddi=
ng-left: 1ex; border-left-color: rgb(204, 204, 204); border-left-width: 1px=
; border-left-style: solid;"><div dir=3D"ltr"><br> <div><div><div>So w=
e have only one possibility</div><div> </div><div>v.insert( v.insert( =
v.insert( v.end(), s1 ), s2 ), s3 );</div>
<div>std::cout << v;</div><div></div></div></div></div></blockquote><=
div><br></div><div>That's not the only possibility, you can wrap the operat=
ion in a lambda and<br></div><div>output the result of the lambda invocatio=
n.<br>
<br></div></div><br></div></div>
</blockquote></div></blockquote></div>
<p></p>
-- <br />
<br />
--- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals" 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_204_12897971.1382528912248--
.
Author: Nevin Liber <nevin@eviloverlord.com>
Date: Wed, 23 Oct 2013 07:51:32 -0400
Raw View
--f46d0434bc14d6e04d04e9672585
Content-Type: text/plain; charset=ISO-8859-1
On 23 October 2013 07:44, Vlad from Moscow <vlad.moscow@mail.ru> wrote:
> Yes, you can. But it will not look very well taking into account a
> possible interchangeability with std::basic_string.
>
That's pretty much true of *anything* in the basic_string interface that
isn't in the interface of the other containers...
I'm pretty much meh (aka neutral to weakly against) this proposal; while
the usefulness of append does come up from time to time, it doesn't come up
all that often, at least in my experience.
--
Nevin ":-)" Liber <mailto:nevin@eviloverlord.com> (847) 691-1404
--
---
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/.
--f46d0434bc14d6e04d04e9672585
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr"><div class=3D"gmail_extra">On 23 October 2013 07:44, Vlad =
from Moscow <span dir=3D"ltr"><<a href=3D"mailto:vlad.moscow@mail.ru" ta=
rget=3D"_blank">vlad.moscow@mail.ru</a>></span> wrote:<br><div class=3D"=
gmail_quote">
<blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1p=
x #ccc solid;padding-left:1ex"><div dir=3D"ltr"><div>Yes, you can. But it w=
ill not look very=A0well taking into account a possible interchangeability =
with std::basic_string. </div>
</div></blockquote><div><br></div><div>That's pretty much true of *anyt=
hing* in the basic_string interface that isn't in the interface of the =
other containers...</div><div><br></div><div>I'm pretty much meh (aka n=
eutral to weakly against) this proposal; while the usefulness of append doe=
s come up from time to time, it doesn't come up all that often, at leas=
t in my experience.</div>
</div>-- <br>=A0Nevin ":-)" Liber=A0 <mailto:<a href=3D"mailto=
:nevin@eviloverlord.com" target=3D"_blank">nevin@eviloverlord.com</a>>=
=A0 (847) 691-1404
</div></div>
<p></p>
-- <br />
<br />
--- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals" 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 />
--f46d0434bc14d6e04d04e9672585--
.
Author: Vlad from Moscow <vlad.moscow@mail.ru>
Date: Wed, 23 Oct 2013 05:01:51 -0700 (PDT)
Raw View
------=_Part_3137_19958784.1382529711140
Content-Type: text/plain; charset=KOI8-R
Content-Transfer-Encoding: quoted-printable
As for me I found out many times when this method would be useful. Even=20
here in the previous message where I showed the difference between insert=
=20
and append I made a mistake because I had in the head std::basic_string.:)=
=20
Moreover sometimes I forgot what iterator insert returns. So if you use=20
such a construction as
=20
auto it =3D v.insert( v.end(), std::begin( a ), std::end( a ) );
=20
you can make a mistake thinking that the next array will be added to the=20
end of the vector
=20
v.insert( it, std::begin( b ), std::end( b ) );
=20
On the other hand if you use append there is no such a problem
=20
v.append( std::begin( a ), std::end( a ) );
v.append( std::begin( b ), std::end( b ) );
=20
This code is very clear opposite to the code with insert.,=20
=20
=D3=D2=C5=C4=C1, 23 =CF=CB=D4=D1=C2=D2=D1 2013 =C7., 15:51:32 UTC+4 =D0=CF=
=CC=D8=DA=CF=D7=C1=D4=C5=CC=D8 Nevin ":-)" Liber=20
=CE=C1=D0=C9=D3=C1=CC:
> On 23 October 2013 07:44, Vlad from Moscow <vlad....@mail.ru <javascript:=
>
> > wrote:
>
>> Yes, you can. But it will not look very well taking into account a=20
>> possible interchangeability with std::basic_string.=20
>>
>
> That's pretty much true of *anything* in the basic_string interface that=
=20
> isn't in the interface of the other containers...
>
> I'm pretty much meh (aka neutral to weakly against) this proposal; while=
=20
> the usefulness of append does come up from time to time, it doesn't come =
up=20
> all that often, at least in my experience.
> --=20
> Nevin ":-)" Liber <mailto:ne...@eviloverlord.com <javascript:>> (847)=
=20
> 691-1404=20
>
--=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_3137_19958784.1382529711140
Content-Type: text/html; charset=KOI8-R
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr"><div>As for me I found out many times when this method wou=
ld be useful. Even here in the previous message where I showed the differen=
ce between insert and append I made a mistake because I had in the head std=
::basic_string.:) Moreover sometimes I forgot what iterator insert returns.=
So if you use such a construction as</div><div> </div><div>auto it =
=3D v.insert( v.end(), std::begin( a ), std::end( a ) );</div><div> </=
div><div>you can make a mistake thinking that the next array will be added =
to the end of the vector</div><div> </div><div>v.insert( it, std::begi=
n( b ), std::end( b ) );</div><div> </div><div>On the other hand if yo=
u use append there is no such a problem</div><div> </div><div>v.append=
( std::begin( a ), std::end( a ) );</div><div>v.append( std::begin( b ), st=
d::end( b ) );</div><div> </div><div>This code is very clear opposite =
to the code with insert., </div><div> </div><div><br>=D3=D2=C5=C4=C1, =
23 =CF=CB=D4=D1=C2=D2=D1 2013 =C7., 15:51:32 UTC+4 =D0=CF=CC=D8=DA=CF=
=D7=C1=D4=C5=CC=D8 Nevin ":-)" Liber =CE=C1=D0=C9=D3=C1=CC:</div><blockquot=
e class=3D"gmail_quote" style=3D"margin: 0px 0px 0px 0.8ex; padding-left: 1=
ex; border-left-color: rgb(204, 204, 204); border-left-width: 1px; border-l=
eft-style: solid;"><div dir=3D"ltr"><div>On 23 October 2013 07:44, Vlad fro=
m Moscow <span dir=3D"ltr"><<a href=3D"javascript:" target=3D"_blank" gd=
f-obfuscated-mailto=3D"X2iPbJjMxTwJ">vlad....@mail.ru</a>></span> wrote:=
<br><div class=3D"gmail_quote">
<blockquote class=3D"gmail_quote" style=3D"margin: 0px 0px 0px 0.8ex; paddi=
ng-left: 1ex; border-left-color: rgb(204, 204, 204); border-left-width: 1px=
; border-left-style: solid;"><div dir=3D"ltr"><div>Yes, you can. But it wil=
l not look very well taking into account a possible interchangeability=
with std::basic_string. </div>
</div></blockquote><div><br></div><div>That's pretty much true of *anything=
* in the basic_string interface that isn't in the interface of the other co=
ntainers...</div><div><br></div><div>I'm pretty much meh (aka neutral to we=
akly against) this proposal; while the usefulness of append does come up fr=
om time to time, it doesn't come up all that often, at least in my experien=
ce.</div>
</div>-- <br> Nevin ":-)" Liber <mailto:<a href=3D"javascript=
:" target=3D"_blank" gdf-obfuscated-mailto=3D"X2iPbJjMxTwJ">ne...@eviloverl=
ord.com</a><wbr>> (847) 691-1404
</div></div>
</blockquote></div>
<p></p>
-- <br />
<br />
--- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals" 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_3137_19958784.1382529711140--
.
Author: Ville Voutilainen <ville.voutilainen@gmail.com>
Date: Wed, 23 Oct 2013 15:02:59 +0300
Raw View
--089e0149c54664418104e9674c70
Content-Type: text/plain; charset=ISO-8859-1
On 23 October 2013 14:51, Nevin Liber <nevin@eviloverlord.com> wrote:
> I'm pretty much meh (aka neutral to weakly against) this proposal; while
> the usefulness of append does come up from time to time, it doesn't come up
> all that often, at least in my experience.
>
>
I have found that novices often expect an append() to be available, but
cope quite quickly
when told that it's named push_back(). The iterator version is much rarer,
as is chaining
or otherwise combining multiple appends. Meh, indeed. I'll stay well out of
the room if
LEWG wishes to discuss this. :)
--
---
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/.
--089e0149c54664418104e9674c70
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr"><br><div class=3D"gmail_extra"><br><br><div class=3D"gmail=
_quote">On 23 October 2013 14:51, Nevin Liber <span dir=3D"ltr"><<a href=
=3D"mailto:nevin@eviloverlord.com" target=3D"_blank">nevin@eviloverlord.com=
</a>></span> wrote:<br>
<blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1p=
x #ccc solid;padding-left:1ex"><div dir=3D"ltr"><div class=3D"gmail_extra">=
I'm pretty much meh (aka neutral to weakly against) this proposal; whil=
e the usefulness of append does come up from time to time, it doesn't c=
ome up all that often, at least in my experience.<div class=3D"gmail_quote"=
>
<span class=3D"HOEnZb"><font color=3D"#888888">
</font></span></div><span class=3D"HOEnZb"><font color=3D"#888888"><br></fo=
nt></span></div></div></blockquote><div><br></div><div>I have found that no=
vices often expect an append() to be available, but cope quite quickly<br>
when told that it's named push_back(). The iterator version is much rar=
er, as is chaining<br>or otherwise combining multiple appends. Meh, indeed.=
I'll stay well out of the room if<br></div><div>LEWG wishes to discuss=
this. :)<br>
</div></div><br></div></div>
<p></p>
-- <br />
<br />
--- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals" 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 />
--089e0149c54664418104e9674c70--
.
Author: Zhihao Yuan <zy@miator.net>
Date: Wed, 23 Oct 2013 11:04:07 -0400
Raw View
On Wed, Oct 23, 2013 at 8:02 AM, Ville Voutilainen
<ville.voutilainen@gmail.com> wrote:
> I have found that novices often expect an append() to be available, but cope
> quite quickly
> when told that it's named push_back().
Interestingly in Python `push_back` is named `append`, and
"bulk insertion at the end" is named `extend` :)
> The iterator version is much rarer,
> as is chaining
> or otherwise combining multiple appends.
If it takes a Range, like Python's `extend`, which takes an
iterable object, that would be more useful, I think :)
I always uses string .append() line by line; chained side-
effects are unnecessary and confusing to me.
> Meh, indeed. I'll stay well out of
> the room if
> LEWG wishes to discuss this. :)
lol
--
Zhihao Yuan, ID lichray
The best way to predict the future is to invent it.
___________________________________________________
4BSD -- http://4bsd.biz/
--
---
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/.
.
Author: Vlad from Moscow <vlad.moscow@mail.ru>
Date: Wed, 23 Oct 2013 09:20:43 -0700 (PDT)
Raw View
------=_Part_441_20704577.1382545243045
Content-Type: text/plain; charset=KOI8-R
Content-Transfer-Encoding: quoted-printable
append shows more clear the intention of the programmer. Consider code
=20
v.insert( it, std::begin( a ), std:;end( a ) );
=20
You can say nothing whether the array is indeed inserted or appended.=20
=20
Word insert only confuses readers because literally insert and append have=
=20
different meaning.
=20
So in my opinion all sequantial containers with method push_back should=20
have the following set of methods:
=20
assign
insert
append
erase
=20
and all these methods shall have the following parameters
=20
size_type n, const T &value;
InputIterator first, InputIterator last
initializer_list<value_type>
=20
in this case they will be interchangeable with clear semantic of their=20
methods.
..=20
=20
=D3=D2=C5=C4=C1, 23 =CF=CB=D4=D1=C2=D2=D1 2013 =C7., 19:04:07 UTC+4 =D0=CF=
=CC=D8=DA=CF=D7=C1=D4=C5=CC=D8 Zhihao Yuan =CE=C1=D0=C9=D3=C1=CC:
> On Wed, Oct 23, 2013 at 8:02 AM, Ville Voutilainen=20
> <ville.vo...@gmail.com <javascript:>> wrote:=20
> > I have found that novices often expect an append() to be available, but=
=20
> cope=20
> > quite quickly=20
> > when told that it's named push_back().=20
>
> Interestingly in Python `push_back` is named `append`, and=20
> "bulk insertion at the end" is named `extend` :)=20
>
> > The iterator version is much rarer,=20
> > as is chaining=20
> > or otherwise combining multiple appends.=20
>
> If it takes a Range, like Python's `extend`, which takes an=20
> iterable object, that would be more useful, I think :)=20
>
> I always uses string .append() line by line; chained side-=20
> effects are unnecessary and confusing to me.=20
>
> > Meh, indeed. I'll stay well out of=20
> > the room if=20
> > LEWG wishes to discuss this. :)=20
>
> lol=20
>
> --=20
> Zhihao Yuan, ID lichray=20
> The best way to predict the future is to invent it.=20
> ___________________________________________________=20
> 4BSD -- http://4bsd.biz/=20
>
--=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_441_20704577.1382545243045
Content-Type: text/html; charset=KOI8-R
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr"><div>append shows more clear the intention of the programm=
er. Consider code</div><div> </div><div>v.insert( it, std::begin( a ),=
std:;end( a ) );</div><div> </div><div>You can say nothing whether th=
e array is indeed inserted or appended. </div><div> </div><div>Word in=
sert only confuses readers because literally insert and append have differe=
nt meaning.</div><div> </div><div>So in my opinion all sequantial cont=
ainers with method push_back should have the following set of methods:</div=
><div> </div><div>assign</div><div>insert</div><div>append</div><div>e=
rase</div><div> </div><div>and all these methods shall have the follow=
ing parameters</div><div> </div><div>size_type n, const T &value;<=
/div><div>InputIterator first, InputIterator last</div><div>initializer_lis=
t<value_type></div><div> </div><div>in this case they will be in=
terchangeable with clear semantic of their methods.</div><div>. </div><div>=
</div><div><br>=D3=D2=C5=C4=C1, 23 =CF=CB=D4=D1=C2=D2=D1 2013 =
=C7., 19:04:07 UTC+4 =D0=CF=CC=D8=DA=CF=D7=C1=D4=C5=CC=D8 Zhihao Yuan =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-left-style: solid;">On Wed, Oct 23, 2013 =
at 8:02 AM, Ville Voutilainen
<br><<a href=3D"javascript:" target=3D"_blank" gdf-obfuscated-mailto=3D"=
YYRXyeHujcMJ">ville.vo...@gmail.com</a>> wrote:
<br>> I have found that novices often expect an append() to be available=
, but cope
<br>> quite quickly
<br>> when told that it's named push_back().
<br>
<br>Interestingly in Python `push_back` is named `append`, and
<br>"bulk insertion at the end" is named `extend` :)
<br>
<br>> The iterator version is much rarer,
<br>> as is chaining
<br>> or otherwise combining multiple appends.
<br>
<br>If it takes a Range, like Python's `extend`, which takes an
<br>iterable object, that would be more useful, I think :)
<br>
<br>I always uses string .append() line by line; chained side-
<br>effects are unnecessary and confusing to me.
<br>
<br>> Meh, indeed. I'll stay well out of
<br>> the room if
<br>> LEWG wishes to discuss this. :)
<br>
<br>lol
<br>
<br>--=20
<br>Zhihao Yuan, ID lichray
<br>The best way to predict the future is to invent it.
<br>______________________________<wbr>_____________________
<br>4BSD -- <a href=3D"http://4bsd.biz/" target=3D"_blank">http://4bsd.biz/=
</a>
<br></blockquote></div>
<p></p>
-- <br />
<br />
--- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals" 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_441_20704577.1382545243045--
.
Author: Nevin Liber <nevin@eviloverlord.com>
Date: Wed, 23 Oct 2013 18:08:10 -0400
Raw View
--f46d0434bc142d3c8004e96fc3b9
Content-Type: text/plain; charset=ISO-8859-1
On 23 October 2013 12:20, Vlad from Moscow <vlad.moscow@mail.ru> wrote:
> append shows more clear the intention of the programmer. Consider code
>
> v.insert( it, std::begin( a ), std:;end( a ) );
>
> You can say nothing whether the array is indeed inserted or appended.
>
Well, they are using an iterator in a variable, so most likely they have
found the position they which to insert the elements of a, regardless of
whether it is technically appending or inserting somewhere else. After
all, if they really meant appending, why not write it instead as
v.insert(v.end(), std::begin(a), std::end(a));?
Contrived situations don't sway me. Bad programmers will write convoluted
code no matter how many member functions we give them.
--
Nevin ":-)" Liber <mailto:nevin@eviloverlord.com> (847) 691-1404
--
---
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/.
--f46d0434bc142d3c8004e96fc3b9
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr"><div class=3D"gmail_extra">On 23 October 2013 12:20, Vlad =
from Moscow <span dir=3D"ltr"><<a href=3D"mailto:vlad.moscow@mail.ru" ta=
rget=3D"_blank">vlad.moscow@mail.ru</a>></span> wrote:<br><div class=3D"=
gmail_quote">
<blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1p=
x #ccc solid;padding-left:1ex"><div dir=3D"ltr"><div>append shows more clea=
r the intention of the programmer. Consider code</div><div>=A0</div><div>v.=
insert( it, std::begin( a ), std:;end( a ) );</div>
<div>=A0</div><div>You can say nothing whether the array is indeed inserted=
or appended.</div></div></blockquote><div><br></div><div>Well, they are us=
ing an iterator in a variable, so most likely they have found the position =
they which to insert the elements of a, regardless of whether it is technic=
ally appending or inserting somewhere else. =A0After all, if they really me=
ant appending, why not write it instead as v.insert(v.end(), std::begin(a),=
std::end(a));?</div>
<div><br></div><div>Contrived situations don't sway me. =A0Bad programm=
ers will write convoluted code no matter how many member functions we give =
them.</div></div>-- <br>=A0Nevin ":-)" Liber=A0 <mailto:<a hre=
f=3D"mailto:nevin@eviloverlord.com" target=3D"_blank">nevin@eviloverlord.co=
m</a>>=A0 (847) 691-1404
</div></div>
<p></p>
-- <br />
<br />
--- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals" 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 />
--f46d0434bc142d3c8004e96fc3b9--
.
Author: Zhihao Yuan <zy@miator.net>
Date: Wed, 23 Oct 2013 18:31:37 -0400
Raw View
--047d7b3a8b02935f5a04e970140a
Content-Type: text/plain; charset=windows-1252
Content-Transfer-Encoding: quoted-printable
On Oct 23, 2013 6:09 PM, "Nevin Liber" <nevin@eviloverlord.com> wrote:
> Contrived situations don't sway me. Bad programmers will write
convoluted code no matter how many member functions we give them.
Hehe=85
I think we'd better not to regard this as merely a syntax sugar. 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 insert().
Not sure how beneficial it is though, but so far it looks not too useless.
--=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/.
--047d7b3a8b02935f5a04e970140a
Content-Type: text/html; charset=windows-1252
Content-Transfer-Encoding: quoted-printable
<p>On Oct 23, 2013 6:09 PM, "Nevin Liber" <<a href=3D"mailto:n=
evin@eviloverlord.com">nevin@eviloverlord.com</a>> wrote:<br>
> Contrived situations don't sway me. =A0Bad programmers will write =
convoluted code no matter how many member functions we give them.</p>
<p>Hehe=85</p>
<p>I think we'd better not to regard this as merely a syntax sugar.=A0 =
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 inse=
rt().=A0 Not sure how beneficial it is though, but so far it looks not too =
useless.</p>
<p></p>
-- <br />
<br />
--- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals" 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 />
--047d7b3a8b02935f5a04e970140a--
.
Author: Vlad from Moscow <vlad.moscow@mail.ru>
Date: Wed, 23 Oct 2013 15:41:46 -0700 (PDT)
Raw View
------=_Part_590_20103831.1382568106226
Content-Type: text/plain; charset=KOI8-R
Content-Transfer-Encoding: quoted-printable
In my opinion the iterator shall be absent as a whole because appending=20
does not require the iterator. It is an useless and superfluous=20
information. it only provokes potential errors and makes it difficult to=20
read code because every time when you meet method insert you should=20
investigate what it does whether it indeed inserts or it appends or a=20
programmer made an error and forgot substitute end() for some other=20
iterator when he was changing the code.
=20
=20
=20
=DE=C5=D4=D7=C5=D2=C7, 24 =CF=CB=D4=D1=C2=D2=D1 2013 =C7., 2:08:10 UTC+4 =
=D0=CF=CC=D8=DA=CF=D7=C1=D4=C5=CC=D8 Nevin ":-)" Liber=20
=CE=C1=D0=C9=D3=C1=CC:
> On 23 October 2013 12:20, Vlad from Moscow <vlad....@mail.ru <javascript:=
>
> > wrote:
>
>> append shows more clear the intention of the programmer. Consider code
>> =20
>> v.insert( it, std::begin( a ), std:;end( a ) );
>> =20
>> You can say nothing whether the array is indeed inserted or appended.
>>
>
> Well, they are using an iterator in a variable, so most likely they have=
=20
> found the position they which to insert the elements of a, regardless of=
=20
> whether it is technically appending or inserting somewhere else. After=
=20
> all, if they really meant appending, why not write it instead as=20
> v.insert(v.end(), std::begin(a), std::end(a));?
>
> Contrived situations don't sway me. Bad programmers will write convolute=
d=20
> code no matter how many member functions we give them.
> --=20
> Nevin ":-)" Liber <mailto:ne...@eviloverlord.com <javascript:>> (847)=
=20
> 691-1404=20
>
--=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_590_20103831.1382568106226
Content-Type: text/html; charset=KOI8-R
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr"><div>In my opinion the iterator shall be absent&=
nbsp;as a whole because appending does not require the iterator. =
It is an useless and superfluous information. it only provokes potential er=
rors and makes it difficult to read code because every time when you meet m=
ethod insert you should investigate what it does whether it indeed inserts =
or it appends or a programmer made an error and forgot substitute end(=
) for some other iterator when he was changing the code.</div><div> </=
div><div> </div><div> </div><div><br>=DE=C5=D4=D7=C5=D2=C7, 24 =
=CF=CB=D4=D1=C2=D2=D1 2013 =C7., 2:08:10 UTC+4 =D0=CF=CC=D8=DA=CF=D7=
=C1=D4=C5=CC=D8 Nevin ":-)" Liber =CE=C1=D0=C9=D3=C1=CC:</div><blockquote c=
lass=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>On 23 October 2013 12:20, Vlad from M=
oscow <span dir=3D"ltr"><<a href=3D"javascript:" target=3D"_blank" gdf-o=
bfuscated-mailto=3D"SAFn_2S9m3gJ">vlad....@mail.ru</a>></span> wrote:<br=
><div class=3D"gmail_quote">
<blockquote class=3D"gmail_quote" style=3D"margin: 0px 0px 0px 0.8ex; paddi=
ng-left: 1ex; border-left-color: rgb(204, 204, 204); border-left-width: 1px=
; border-left-style: solid;"><div dir=3D"ltr"><div>append shows more clear =
the intention of the programmer. Consider code</div><div> </div><div>v=
..insert( it, std::begin( a ), std:;end( a ) );</div>
<div> </div><div>You can say nothing whether the array is indeed inser=
ted or appended.</div></div></blockquote><div><br></div><div>Well, they are=
using an iterator in a variable, so most likely they have found the positi=
on they which to insert the elements of a, regardless of whether it is tech=
nically appending or inserting somewhere else. After all, if they rea=
lly meant appending, why not write it instead as v.insert(v.end(), std::beg=
in(a), std::end(a));?</div>
<div><br></div><div>Contrived situations don't sway me. Bad programme=
rs will write convoluted code no matter how many member functions we give t=
hem.</div></div>-- <br> Nevin ":-)" Liber <mailto:<a href=3D"=
javascript:" target=3D"_blank" gdf-obfuscated-mailto=3D"SAFn_2S9m3gJ">ne...=
@eviloverlord.com</a><wbr>> (847) 691-1404
</div></div>
</blockquote></div>
<p></p>
-- <br />
<br />
--- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals" 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_590_20103831.1382568106226--
.
Author: Zhihao Yuan <zy@miator.net>
Date: Wed, 23 Oct 2013 18:52:13 -0400
Raw View
--001a1132e6e23d08d804e9705ee5
Content-Type: text/plain; charset=ISO-8859-1
On Oct 23, 2013 6:31 PM, "Zhihao Yuan" <zy@miator.net> wrote:
> I think we'd better not to regard this as merely a syntax sugar. 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
insert(). Not sure how beneficial it is though, but so far it looks not
too useless.
PS: If you agree with this rationale, I would suggest to add prepend()
method to deque, list, and forward_list as well.
--
---
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/.
--001a1132e6e23d08d804e9705ee5
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
<p>On Oct 23, 2013 6:31 PM, "Zhihao Yuan" <<a href=3D"mailto:z=
y@miator.net">zy@miator.net</a>> wrote:<br>
> I think we'd better not to regard this as merely a syntax sugar.=
=A0 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 =
insert().=A0 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>
<p></p>
-- <br />
<br />
--- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals" 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 />
--001a1132e6e23d08d804e9705ee5--
.
Author: Vlad from Moscow <vlad.moscow@mail.ru>
Date: Wed, 23 Oct 2013 16:05:06 -0700 (PDT)
Raw View
------=_Part_4476_2581461.1382569506228
Content-Type: text/plain; charset=KOI8-R
Content-Transfer-Encoding: quoted-printable
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 everywhere=
=20
in code for insert. I am sure that through a month of such coding he will=
=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 =CE=C1=D0=C9=D3=C1=CC:
> On Oct 23, 2013 6:31 PM, "Zhihao Yuan" <z...@miator.net <javascript:>>=20
> 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 be=
=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 not=
=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
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_4476_2581461.1382569506228
Content-Type: text/html; charset=KOI8-R
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr"><div>In fact there is nothing new with the method append b=
ecause it already exists for std::basic_string. 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 he will quickly understand that method append is necessar=
y.</div><div> </div><div>Introducing method append just makes&nbs=
p;the common 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 =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:</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-left-style: solid;"><p>On Oct 23, 2013 6:31 PM, "Zhihao =
Yuan" <<a href=3D"javascript:" target=3D"_blank" gdf-obfuscated-mailto=
=3D"7J8G4IRVadkJ">z...@miator.net</a>> wrote:<br>
> I think we'd better not to regard this as merely a syntax sugar. =
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(). 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>
</blockquote></div>
<p></p>
-- <br />
<br />
--- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals" 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_4476_2581461.1382569506228--
.
Author: "Billy O'Neal" <billy.oneal@gmail.com>
Date: Wed, 23 Oct 2013 16:07:04 -0700
Raw View
--e89a8fb1fbfec1444a04e970957e
Content-Type: text/plain; charset=KOI8-R
Content-Transfer-Encoding: quoted-printable
Again, append makes sense for basic_string because it corresponds to
basic_string's operator+=3D. That operation doesn't necessarily make sense
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.moscow@mail.ru>wrot=
e:
> In fact there is nothing new with the method append because it already
> exists for std::basic_string. If somebody has some doubts then I advise t=
o
> try do not use append with std::basic string and substitute it everywhere
> in code for insert. I am sure that through a month of such coding he will
> quickly understand that method append is necessary.
>
> Introducing method append just makes the common interface of sequential
> 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
> =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
>> 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
>> insert(). Not sure how beneficial it is though, but so far it looks not
>> too useless.
>>
>> PS: If you agree with this rationale, I would suggest to add prepend()
>> method to deque, list, and forward_list as well.
>>
> --
>
> ---
> 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/.
--e89a8fb1fbfec1444a04e970957e
Content-Type: text/html; charset=KOI8-R
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr">Again, append makes sense for basic_string because it corr=
esponds to basic_string's operator+=3D. That operation doesn't nece=
ssarily make sense for all containers.</div><div class=3D"gmail_extra"><br =
clear=3D"all">
<div><div dir=3D"ltr"><div>Billy O'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 Wed, Oct 23, 2013 at 4:05 PM, Vlad fr=
om Moscow <span dir=3D"ltr"><<a href=3D"mailto:vlad.moscow@mail.ru" targ=
et=3D"_blank">vlad.moscow@mail.ru</a>></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>In fact there is nothing new with the method append b=
ecause it already exists for std::basic_string.=9AIf somebody has some doub=
ts then I advise to try do not use append with std::basic string and substi=
tute it everywhere in code for insert. I am sure that through a month of su=
ch coding=9Ahe will quickly understand that method append is necessary.</di=
v>
<div>=9A</div><div>Introducing method append=9Ajust makes=9Athe common inte=
rface of sequential containers more consistent.</div><div><br>=DE=C5=D4=D7=
=C5=D2=C7, 24 =CF=CB=D4=D1=C2=D2=D1 2013=9A=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:</div><blockquot=
e 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">
<p>On Oct 23, 2013 6:31 PM, "Zhihao Yuan" <<a>z...@miator.net<=
/a>> wrote:<br>
> I think we'd better not to regard this as merely a syntax sugar.=
=9A 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 =
insert().=9A 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 class=3D"HOEnZb"><=
font color=3D"#888888">
</font></span></blockquote></div><span class=3D"HOEnZb"><font color=3D"#888=
888">
<p></p>
-- <br>
=9A<br>
--- <br>
You received this message because you are subscribed to the Google Groups &=
quot;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"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>
</font></span></blockquote></div><br></div>
<p></p>
-- <br />
<br />
--- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals" 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 />
--e89a8fb1fbfec1444a04e970957e--
.
Author: Vlad from Moscow <vlad.moscow@mail.ru>
Date: Wed, 23 Oct 2013 16:32:45 -0700 (PDT)
Raw View
------=_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>=
</div><div>To demonstrate that append looks much better than insert I=
will show the following assignment.</div><div> Let;s assume that ther=
e is a vector v1 and you need to copy its elements in another vector =
v2 excluding some range that specified by a pair of iterators. Fo=
r example one iterator points the first negative value of the vector a=
nd the second iterator points the last negative value of the vector. T=
he simplest way to do the assignment is to write</div><div> </div><div=
>std::vector<int> v2( v1.begin(), range.first );</div><div>v2.ap=
pend( std::next( range.second ), v1.end() );</div><div> </di=
v><div>That is at first the part of the original vector before the first it=
erator was copied and then the tail of the original vector was a=
ppended.. The code looks very logically and clearly due to using of append.=
</div><div> </div><div> </div><div> </div><div><br>=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 =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"><<a href=3D"javascript:" target=3D"_blank" g=
df-obfuscated-mailto=3D"9PGLlkUS58YJ">vlad....@mail.ru</a>></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. 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 he will quickly understand that method append is necessar=
y.</div>
<div> </div><div>Introducing method append just makes 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 =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" <<a>z...@miator.net</a>> wr=
ote:<br>
> I think we'd better not to regard this as merely a syntax sugar. =
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(). 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>
<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 />
<br />
--- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals" 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--
.
Author: "Billy O'Neal" <billy.oneal@gmail.com>
Date: Wed, 23 Oct 2013 16:51:46 -0700
Raw View
--089e0160c244a2b4dd04e9713503
Content-Type: text/plain; charset=KOI8-R
Content-Transfer-Encoding: quoted-printable
And yet, is no less clearly expressed as:
std::vector<int> v2( v1.begin(), range.first );
append( v2, std::next( range.second ), v1.end() );
which you can already do today without needing a standard modification.
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:32 PM, Vlad from Moscow <vlad.moscow@mail.ru>wrot=
e:
> Billy, I do not think that append flows out of operator +=3D. It looks li=
ke
> that operator +=3D flows out of append.:)
>
> To demonstrate that append looks much better than insert I will show the
> following assignment.
> Let;s assume that there is a vector v1 and you need to copy its element=
s
> in another vector v2 excluding some range that specified by a pair
> of iterators. For example one iterator points the first negative value of
> the vector and the second iterator points the last negative value of the
> vector. The simplest way to do the assignment is to write
>
> std::vector<int> v2( v1.begin(), range.first );
> v2.append( std::next( range.second ), v1.end() );
>
> That is at first the part of the original vector before the first iterato=
r
> was copied and then the tail of the original vector was appended.. The
> code looks very logically and clearly due to using of append.
>
>
>
>
> =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
> =CE=C1=D0=C9=D3=C1=CC:
>
>> Again, append makes sense for basic_string because it corresponds to
>> basic_string's operator+=3D. That operation doesn't necessarily make sen=
se
>> for all containers.
>>
>> 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 Wed, Oct 23, 2013 at 4:05 PM, Vlad from Moscow <vlad....@mail.ru>wrot=
e:
>>
>>> In fact there is nothing new with the method append because it already
>>> exists for std::basic_string. If somebody has some doubts then I advise=
to
>>> try do not use append with std::basic string and substitute it everywhe=
re
>>> in code for insert. I am sure that through a month of such coding he wi=
ll
>>> quickly understand that method append is necessary.
>>>
>>> Introducing method append just makes the common interface of sequential
>>> 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
>>> =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
>>>> 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
>>>> insert(). Not sure how beneficial it is though, but so far it looks n=
ot
>>>> too useless.
>>>>
>>>> PS: If you agree with this rationale, I would suggest to add prepend()
>>>> method to deque, list, and forward_list as well.
>>>>
>>> --
>>>
>>> ---
>>> 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/.
--089e0160c244a2b4dd04e9713503
Content-Type: text/html; charset=KOI8-R
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr">And yet, is no less clearly expressed as:<div><div style=
=3D"font-family:arial,sans-serif;font-size:13px">std::vector<int> v2(=
v1.begin(),=9Arange.first );</div><div style=3D"font-family:arial,sans-ser=
if;font-size:13px">
append( v2, std::next(=9Arange.second ), v1.end()=9A);</div></div><div styl=
e=3D"font-family:arial,sans-serif;font-size:13px"><br></div><div style=3D"f=
ont-family:arial,sans-serif;font-size:13px">which you can already do today =
without needing a standard modification.</div>
</div><div class=3D"gmail_extra"><br clear=3D"all"><div><div dir=3D"ltr"><d=
iv>Billy O'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"_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 Wed, Oct 23, 2013 at 4:32 PM, Vlad fr=
om Moscow <span dir=3D"ltr"><<a href=3D"mailto:vlad.moscow@mail.ru" targ=
et=3D"_blank">vlad.moscow@mail.ru</a>></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>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>=
=9A</div><div>To demonstrate that append looks much better than insert I wi=
ll show the following assignment.</div>
<div>=9ALet;s assume that there is a vector v1 and you need to copy=9A its =
elements in another vector v2 excluding some range that specified by a=9Apa=
ir of=9Aiterators. For example one iterator points=9Athe first negative val=
ue of the vector and the=9Asecond iterator points the last negative value o=
f the vector. The simplest way to do the assignment is to write</div>
<div>=9A</div><div>std::vector<int> v2( v1.begin(),=9Arange.first );<=
/div><div>v2.append( std::next(=9Arange.second ), v1.end()=9A);</div><div>=
=9A</div><div>That is at first the part of the original vector before the f=
irst iterator was copied and then=9Athe tail of the original vector =9Awas =
appended.. The code looks very logically and clearly due to using of append=
..</div>
<div>=9A</div><div>=9A</div><div>=9A</div><div><br>=DE=C5=D4=D7=C5=D2=C7, 2=
4 =CF=CB=D4=D1=C2=D2=D1 2013=9A=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><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 class=3D"im"><div dir=3D"ltr">Again, append makes sense for basic_stri=
ng because it corresponds to basic_string's operator+=3D. That operatio=
n doesn't necessarily make sense for all containers.</div></div><div><d=
iv class=3D"im">
<br clear=3D"all">
<div><div dir=3D"ltr"><div>Billy O'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/<u></u>users/82320/billy-oneal</a=
></div>
<div>Malware Response Instructor - BleepingComputer.com</div></div></div>
<br><br></div><div class=3D"gmail_quote"><div class=3D"im">On Wed, Oct 23, =
2013 at 4:05 PM, Vlad from Moscow <span dir=3D"ltr"><<a>vlad....@mail.ru=
</a>></span> wrote:<br></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-left-style:solid">
<div class=3D"im">
<div dir=3D"ltr"><div>In fact there is nothing new with the method append b=
ecause it already exists for std::basic_string.=9AIf somebody has some doub=
ts then I advise to try do not use append with std::basic string and substi=
tute it everywhere in code for insert. I am sure that through a month of su=
ch coding=9Ahe will quickly understand that method append is necessary.</di=
v>
<div>=9A</div><div>Introducing method append=9Ajust makes=9Athe common inte=
rface of sequential containers more consistent.</div><div><br>=DE=C5=D4=D7=
=C5=D2=C7, 24 =CF=CB=D4=D1=C2=D2=D1 2013=9A=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:</div><blockquot=
e 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">
<p>On Oct 23, 2013 6:31 PM, "Zhihao Yuan" <<a>z...@miator.net<=
/a>> wrote:<br>
> I think we'd better not to regard this as merely a syntax sugar.=
=9A 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 =
insert().=9A 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></div><span><font color=3D"#888888"><div c=
lass=3D"im">
<p></p>
-- <br>
=9A<br>
--- <br>
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals" 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 class=
=3D"im"><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></font></span></blockquote></div><br></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" 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 />
<br />
--- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals" 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 />
--089e0160c244a2b4dd04e9713503--
.
Author: Vlad from Moscow <vlad.moscow@mail.ru>
Date: Wed, 23 Oct 2013 16:57:48 -0700 (PDT)
Raw View
------=_Part_4734_18368418.1382572668528
Content-Type: text/plain; charset=KOI8-R
Content-Transfer-Encoding: quoted-printable
In my personal opinion there is two problems. It is not clear what is the=
=20
return type of append. And such record can confuse users because they will=
=20
think that they can use any container because the function iis a general=20
non-member function.
=DE=C5=D4=D7=C5=D2=C7, 24 =CF=CB=D4=D1=C2=D2=D1 2013 =C7., 3:51:46 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:
> And yet, is no less clearly expressed as:
> std::vector<int> v2( v1.begin(), range.first );
> append( v2, std::next( range.second ), v1.end() );
>
> which you can already do today without needing a standard modification.
>
> 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:32 PM, Vlad from Moscow <vlad....@mail.ru<javas=
cript:>
> > wrote:
>
>> Billy, I do not think that append flows out of operator +=3D. It looks l=
ike=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=20
>> elements in another vector v2 excluding some range that specified by a p=
air=20
>> of iterators. For example one iterator points the first negative value o=
f=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=20
>> iterator was copied and then the tail of the original vector was=20
>> appended.. The code looks very logically and clearly due to using of app=
end.
>> =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 se=
nse=20
>>> for all containers.
>>>
>>> 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 Wed, Oct 23, 2013 at 4:05 PM, Vlad from Moscow <vlad....@mail.ru>wro=
te:
>>>
>>>> In fact there is nothing new with the method append because it=20
>>>> already exists for std::basic_string. If somebody has some doubts then=
I=20
>>>> advise to try do not use append with std::basic string and substitute =
it=20
>>>> everywhere in code for insert. I am sure that through a month of such=
=20
>>>> coding he will quickly understand that method append is necessary.
>>>> =20
>>>> Introducing method append just makes the common interface of sequentia=
l=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=
be=20
>>>>> end(), append() can be implemented in a much simpler way compared wit=
h=20
>>>>> insert(). Not sure how beneficial it is though, but so far it looks =
not=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=20
>>>> Groups "ISO C++ Standard - Future Proposals" group.
>>>> To unsubscribe from this group and stop receiving emails from it, send=
=20
>>>> 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/=
>
>>>> .
>>>>
>>>
>>> --=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_4734_18368418.1382572668528
Content-Type: text/html; charset=KOI8-R
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr"><div>In my personal opinion there is two problems. It is n=
ot clear what is the return type of append. And such record can confuse use=
rs because they will think that they can use any container because the func=
tion iis a general non-member function.</div><div><br>=DE=C5=D4=D7=C5=D2=C7=
, 24 =CF=CB=D4=D1=C2=D2=D1 2013 =C7., 3:51:46 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><blockquote cla=
ss=3D"gmail_quote" style=3D"margin: 0px 0px 0px 0.8ex; padding-left: 1ex; b=
order-left-color: rgb(204, 204, 204); border-left-width: 1px; border-left-s=
tyle: solid;"><div dir=3D"ltr">And yet, is no less clearly expressed as:<di=
v><div style=3D"font-family: arial,sans-serif; font-size: 13px;">std::vecto=
r<int> v2( v1.begin(), range.first );</div><div style=3D"font-fa=
mily: arial,sans-serif; font-size: 13px;">
append( v2, std::next( range.second ), v1.end() );</div></div><di=
v style=3D"font-family: arial,sans-serif; font-size: 13px;"><br></div><div =
style=3D"font-family: arial,sans-serif; font-size: 13px;">which you can alr=
eady do today without needing a standard modification.</div>
</div><div><br clear=3D"all"><div><div dir=3D"ltr"><div>Billy O'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/u=
sers/82320/billy-oneal" target=3D"_blank">http://stackoverflow.com/<wbr>use=
rs/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:32 PM, Vlad fr=
om Moscow <span dir=3D"ltr"><<a href=3D"javascript:" target=3D"_blank" g=
df-obfuscated-mailto=3D"nypj9ur6xWoJ">vlad....@mail.ru</a>></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>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>=
</div><div>To demonstrate that append looks much better than insert I=
will show the following assignment.</div>
<div> Let;s assume that there is a vector v1 and you need to copy =
; its elements in another vector v2 excluding some range that specified by =
a pair of iterators. For example one iterator points the fir=
st negative value of the vector and the second iterator points the las=
t negative value of the vector. The simplest way to do the assignment is to=
write</div>
<div> </div><div>std::vector<int> v2( v1.begin(), range.fir=
st );</div><div>v2.append( std::next( range.second ), v1.end() );=
</div><div> </div><div>That is at first the part of the original vecto=
r before the first iterator was copied and then the tail of the origin=
al vector was appended.. The code looks very logically and clearly du=
e to using of append.</div>
<div> </div><div> </div><div> </div><div><br>=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 =CE=C1=D0=C9=D3=C1=CC:</div><blockquo=
te 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><div dir=3D"ltr">Again, append makes sense for basic_string because it=
corresponds to basic_string's operator+=3D. That operation doesn't necessa=
rily make sense for all containers.</div></div><div><div>
<br clear=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/<u></u>users<wbr>/82320/billy-oneal</=
a></div>
<div>Malware Response Instructor - BleepingComputer.com</div></div></div>
<br><br></div><div class=3D"gmail_quote"><div>On Wed, Oct 23, 2013 at 4:05 =
PM, Vlad from Moscow <span dir=3D"ltr"><<a>vlad....@mail.ru</a>></spa=
n> wrote:<br></div><blockquote class=3D"gmail_quote" style=3D"margin: 0px 0=
px 0px 0.8ex; padding-left: 1ex; border-left-color: rgb(204, 204, 204); bor=
der-left-width: 1px; border-left-style: solid;">
<div>
<div dir=3D"ltr"><div>In fact there is nothing new with the method append b=
ecause it already exists for std::basic_string. 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 he will quickly understand that method append is necessar=
y.</div>
<div> </div><div>Introducing method append just makes 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 =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" <<a>z...@miator.net</a>> wr=
ote:<br>
> I think we'd better not to regard this as merely a syntax sugar. =
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(). 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></div><span><font color=3D"#888888"><div>
<p></p>
-- <br>
<br>
--- <br>
You received this message because you are subscribed to the Google Groups "=
ISO C++ Standard - Future Proposals" 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<wbr=
>cpp.org/group/std-<u></u>proposals/</a>.<br>
</div></font></span></blockquote></div><br></div>
</blockquote></div><div><div>
<p></p>
-- <br>
<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"=
nypj9ur6xWoJ">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"nypj9ur6xWoJ">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>
</div></div></blockquote></div><br></div>
</blockquote></div>
<p></p>
-- <br />
<br />
--- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals" 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_4734_18368418.1382572668528--
.
Author: Vlad from Moscow <vlad.moscow@mail.ru>
Date: Wed, 23 Oct 2013 16:59:47 -0700 (PDT)
Raw View
------=_Part_4270_4143974.1382572787857
Content-Type: text/plain; charset=KOI8-R
Content-Transfer-Encoding: quoted-printable
They will think so by analogy with other similar general functions as for=
=20
example advance that can be used with any type of iterators (except output=
=20
iterators).
=DE=C5=D4=D7=C5=D2=C7, 24 =CF=CB=D4=D1=C2=D2=D1 2013 =C7., 3:57:48 UTC+4 =
=D0=CF=CC=D8=DA=CF=D7=C1=D4=C5=CC=D8 Vlad from Moscow=20
=CE=C1=D0=C9=D3=C1=CC:
> In my personal opinion there is two problems. It is not clear what is the=
=20
> return type of append. And such record can confuse users because they wil=
l=20
> think that they can use any container because the function iis a general=
=20
> non-member function.
>
> =DE=C5=D4=D7=C5=D2=C7, 24 =CF=CB=D4=D1=C2=D2=D1 2013 =C7., 3:51:46 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:
>
>> And yet, is no less clearly expressed as:
>> std::vector<int> v2( v1.begin(), range.first );
>> append( v2, std::next( range.second ), v1.end() );
>>
>> which you can already do today without needing a standard modification.
>>
>> 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:32 PM, Vlad from Moscow <vlad....@mail.ru>wrot=
e:
>>
>>> Billy, I do not think that append flows out of operator +=3D. It looks=
=20
>>> like that operator +=3D flows out of append.:)
>>> =20
>>> To demonstrate that append looks much better than insert I will show th=
e=20
>>> following assignment.
>>> Let;s assume that there is a vector v1 and you need to copy its=20
>>> elements 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 th=
e=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=20
>>> iterator was copied and then the tail of the original vector was=20
>>> appended.. The code looks very logically and clearly due to using of ap=
pend.
>>> =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 s=
ense=20
>>>> for all containers.
>>>>
>>>> Billy O'Neal
>>>> https://github.com/BillyONeal/ <https://bitbucket.org/BillyONeal/>
>>>> http://stackoverflow.com/**users/82320/billy-oneal<http://stackoverflo=
w.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>wr=
ote:
>>>>
>>>>> In fact there is nothing new with the method append because it=20
>>>>> already exists for std::basic_string. If somebody has some doubts the=
n I=20
>>>>> advise to try do not use append with std::basic string and substitute=
it=20
>>>>> everywhere in code for insert. I am sure that through a month of such=
=20
>>>>> coding he will quickly understand that method append is necessary.
>>>>> =20
>>>>> Introducing method append just makes the common interface of=20
>>>>> sequential containers more consistent.
>>>>>
>>>>> =DE=C5=D4=D7=C5=D2=C7, 24 =CF=CB=D4=D1=C2=D2=D1 2013 =C7., 2:52:13 UT=
C+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 t=
o be=20
>>>>>> end(), append() can be implemented in a much simpler way compared wi=
th=20
>>>>>> insert(). Not sure how beneficial it is though, but so far it looks=
not=20
>>>>>> too useless.
>>>>>>
>>>>>> PS: If you agree with this rationale, I would suggest to add=20
>>>>>> prepend() method to deque, list, and forward_list as well.
>>>>>>
>>>>> --=20
>>>>> =20
>>>>> ---=20
>>>>> You received this message because you are subscribed to the Google=20
>>>>> Groups "ISO C++ Standard - Future Proposals" group.
>>>>> To unsubscribe from this group and stop receiving emails from it, sen=
d=20
>>>>> 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-proposal=
s/>
>>>>> .
>>>>>
>>>>
>>>> --=20
>>> =20
>>> ---=20
>>> You received this message because you are subscribed to the Google=20
>>> Groups "ISO C++ Standard - Future Proposals" group.
>>> To unsubscribe from this group and stop receiving emails from it, send=
=20
>>> an email to std-proposal...@isocpp.org.
>>> To post to this group, send email to std-pr...@isocpp.org.
>>> 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_4270_4143974.1382572787857
Content-Type: text/html; charset=KOI8-R
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr"><div>They will think so by analogy with other similar gene=
ral functions as for example advance that can be used with any type of iter=
ators (except output iterators).</div><div><br>=DE=C5=D4=D7=C5=D2=C7, 24 =
=CF=CB=D4=D1=C2=D2=D1 2013 =C7., 3:57:48 UTC+4 =D0=CF=CC=D8=DA=CF=D7=
=C1=D4=C5=CC=D8 Vlad from Moscow =CE=C1=D0=C9=D3=C1=CC:</div><blockquote cl=
ass=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 my personal opinion there is two pr=
oblems. It is not clear what is the return type of append. And such record =
can confuse users because they will think that they can use any container b=
ecause the function iis a general non-member function.</div><div><br>=DE=C5=
=D4=D7=C5=D2=C7, 24 =CF=CB=D4=D1=C2=D2=D1 2013 =C7., 3:51:46 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>=
<blockquote class=3D"gmail_quote" style=3D"margin: 0px 0px 0px 0.8ex; paddi=
ng-left: 1ex; border-left-color: rgb(204, 204, 204); border-left-width: 1px=
; border-left-style: solid;"><div dir=3D"ltr">And yet, is no less clearly e=
xpressed as:<div><div style=3D"font-family: arial,sans-serif; font-size: 13=
px;">std::vector<int> v2( v1.begin(), range.first );</div><div s=
tyle=3D"font-family: arial,sans-serif; font-size: 13px;">
append( v2, std::next( range.second ), v1.end() );</div></div><di=
v style=3D"font-family: arial,sans-serif; font-size: 13px;"><br></div><div =
style=3D"font-family: arial,sans-serif; font-size: 13px;">which you can alr=
eady do today without needing a standard modification.</div>
</div><div><br clear=3D"all"><div><div dir=3D"ltr"><div>Billy O'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/u=
sers/82320/billy-oneal" target=3D"_blank">http://stackoverflow.com/<wbr>use=
rs/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:32 PM, Vlad fr=
om Moscow <span dir=3D"ltr"><<a>vlad....@mail.ru</a>></span> wrote:<b=
r><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;">
<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>=
</div><div>To demonstrate that append looks much better than insert I=
will show the following assignment.</div>
<div> Let;s assume that there is a vector v1 and you need to copy =
; its elements in another vector v2 excluding some range that specified by =
a pair of iterators. For example one iterator points the fir=
st negative value of the vector and the second iterator points the las=
t negative value of the vector. The simplest way to do the assignment is to=
write</div>
<div> </div><div>std::vector<int> v2( v1.begin(), range.fir=
st );</div><div>v2.append( std::next( range.second ), v1.end() );=
</div><div> </div><div>That is at first the part of the original vecto=
r before the first iterator was copied and then the tail of the origin=
al vector was appended.. The code looks very logically and clearly du=
e to using of append.</div>
<div> </div><div> </div><div> </div><div><br>=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 =CE=C1=D0=C9=D3=C1=CC:</div><blockquo=
te 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><div dir=3D"ltr">Again, append makes sense for basic_string because it=
corresponds to basic_string's operator+=3D. That operation doesn't necessa=
rily make sense for all containers.</div></div><div><div>
<br clear=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/<u></u>users<wbr>/82320/billy-oneal</=
a></div>
<div>Malware Response Instructor - BleepingComputer.com</div></div></div>
<br><br></div><div class=3D"gmail_quote"><div>On Wed, Oct 23, 2013 at 4:05 =
PM, Vlad from Moscow <span dir=3D"ltr"><<a>vlad....@mail.ru</a>></spa=
n> wrote:<br></div><blockquote class=3D"gmail_quote" style=3D"margin: 0px 0=
px 0px 0.8ex; padding-left: 1ex; border-left-color: rgb(204, 204, 204); bor=
der-left-width: 1px; border-left-style: solid;">
<div>
<div dir=3D"ltr"><div>In fact there is nothing new with the method append b=
ecause it already exists for std::basic_string. 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 he will quickly understand that method append is necessar=
y.</div>
<div> </div><div>Introducing method append just makes 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 =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" <<a>z...@miator.net</a>> wr=
ote:<br>
> I think we'd better not to regard this as merely a syntax sugar. =
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(). 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></div><span><font color=3D"#888888"><div>
<p></p>
-- <br>
<br>
--- <br>
You received this message because you are subscribed to the Google Groups "=
ISO C++ Standard - Future Proposals" 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<wbr=
>cpp.org/group/std-<u></u>proposals/</a>.<br>
</div></font></span></blockquote></div><br></div>
</blockquote></div><div><div>
<p></p>
-- <br>
<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>std-proposal...@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/<wbr>isocpp.or=
g/group/std-<wbr>proposals/</a>.<br>
</div></div></blockquote></div><br></div>
</blockquote></div></blockquote></div>
<p></p>
-- <br />
<br />
--- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals" 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_4270_4143974.1382572787857--
.
Author: Zhihao Yuan <zy@miator.net>
Date: Wed, 23 Oct 2013 20:10:28 -0400
Raw View
On Wed, Oct 23, 2013 at 7:05 PM, Vlad from Moscow <vlad.moscow@mail.ru> wrote:
> In fact there is nothing new with the method append because it already
> exists for std::basic_string. If somebody has some doubts then I advise to
> try do not use append with std::basic string and substitute it everywhere in
> code for insert. I am sure that through a month of such coding he will
> quickly understand that method append is necessary.
>
> Introducing method append just makes the common interface of sequential
> containers more consistent.
I would say please forget about basic_string. basic_string
is not a general purpose container, so there is minimal reason
to say "more consistent". Containers and string are different.
For example, string's insert() methods returns string&, do you
want containers' insert() also return container&? Leave different
things different.
So far I understand append() as "bulk push_back", so I suggested
to have a "bulk push_front" as well, both as simplified interfaces
to insert(). Now I think it would be more clear if we name append()
`extend_back`, and prepend() `extend_front`. Just keep away from
string's append(), which even can take a pointer to char -- don't tell
me you want to take T* as well.
--
Zhihao Yuan, ID lichray
The best way to predict the future is to invent it.
___________________________________________________
4BSD -- http://4bsd.biz/
--
---
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/.
.
Author: Evgeny Panasyuk <evgeny.panasyuk@gmail.com>
Date: Wed, 23 Oct 2013 17:10:43 -0700 (PDT)
Raw View
------=_Part_4430_2730933.1382573443810
Content-Type: text/plain; charset=ISO-8859-1
>
> They will think so by analogy with other similar general functions as for
> example advance that can be used with any type of iterators (except output
> iterators).
>
Generic function does not imply that it should work for everything.
std::lower_bound does not work for input iterators.std::sort works only for
random access.
--
---
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/.
------=_Part_4430_2730933.1382573443810
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr"><blockquote class=3D"gmail_quote" style=3D"margin: 0;margi=
n-left: 0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;"><div dir=3D"l=
tr"><div>They will think so by analogy with other similar general functions=
as for example advance that can be used with any type of iterators (except=
output iterators).</div></div></blockquote><div><br><h1>Generic function d=
oes not imply that it should work for everything. <br></h1><h1><span class=
=3D"namespace" title=3D"namespace std">std::</span>lower_bound does not wor=
k for input iterators.</h1><h1>std::sort works only for random access.<br><=
/h1> </div></div>
<p></p>
-- <br />
<br />
--- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals" 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_4430_2730933.1382573443810--
.
Author: "Billy O'Neal" <billy.oneal@gmail.com>
Date: Wed, 23 Oct 2013 17:10:55 -0700
Raw View
--089e0160c2440d4cc704e9717a7d
Content-Type: text/plain; charset=KOI8-R
Content-Transfer-Encoding: quoted-printable
>It is not clear what is the return type of append.
By that standard, the return type of append here isn't clear either:
v2.append( std::next( range.second ), v1.end() );
Member-ness or nonmember-ness doesn't tell the caller *anything* about the
return type.
>can confuse users because they will think that they can use any container
because the function iis a general non-member function
By that metric, any STL algorithm that requires bidirectional iterators
wouldn't be allowed, because they don't work with input iterators. In fact,
advance would be a great *counter example* to your claim, because it isn't
obvious why std::advance(std::istream_iterator( ... ), -2) wouldn't work.
Users are expected to understand the function they are calling before
calling it.
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:59 PM, Vlad from Moscow <vlad.moscow@mail.ru>wrot=
e:
> They will think so by analogy with other similar general functions as for
> example advance that can be used with any type of iterators (except outpu=
t
> iterators).
>
> =DE=C5=D4=D7=C5=D2=C7, 24 =CF=CB=D4=D1=C2=D2=D1 2013 =C7., 3:57:48 UTC+4 =
=D0=CF=CC=D8=DA=CF=D7=C1=D4=C5=CC=D8 Vlad from Moscow
> =CE=C1=D0=C9=D3=C1=CC:
>
>> In my personal opinion there is two problems. It is not clear what is th=
e
>> return type of append. And such record can confuse users because they wi=
ll
>> think that they can use any container because the function iis a general
>> non-member function.
>>
>> =DE=C5=D4=D7=C5=D2=C7, 24 =CF=CB=D4=D1=C2=D2=D1 2013 =C7., 3:51:46 UTC+4=
=D0=CF=CC=D8=DA=CF=D7=C1=D4=C5=CC=D8 Billy O'Neal
>> =CE=C1=D0=C9=D3=C1=CC:
>>
>>> And yet, is no less clearly expressed as:
>>> std::vector<int> v2( v1.begin(), range.first );
>>> append( v2, std::next( range.second ), v1.end() );
>>>
>>> which you can already do today without needing a standard modification.
>>>
>>> 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 Wed, Oct 23, 2013 at 4:32 PM, Vlad from Moscow <vlad....@mail.ru>wro=
te:
>>>
>>>> Billy, I do not think that append flows out of operator +=3D. It looks
>>>> like that operator +=3D flows out of append.:)
>>>>
>>>> To demonstrate that append looks much better than insert I will show
>>>> the following assignment.
>>>> Let;s assume that there is a vector v1 and you need to copy its
>>>> elements in another vector v2 excluding some range that specified by a=
pair
>>>> of iterators. For example one iterator points the first negative value=
of
>>>> the vector and the second iterator points the last negative value of t=
he
>>>> vector. The simplest way to do the assignment is to write
>>>>
>>>> std::vector<int> v2( v1.begin(), range.first );
>>>> v2.append( std::next( range.second ), v1.end() );
>>>>
>>>> That is at first the part of the original vector before the first
>>>> iterator was copied and then the tail of the original vector was
>>>> appended.. The code looks very logically and clearly due to using of a=
ppend.
>>>>
>>>>
>>>>
>>>>
>>>> =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
>>>> =CE=C1=D0=C9=D3=C1=CC:
>>>>
>>>>> Again, append makes sense for basic_string because it corresponds to
>>>>> basic_string's operator+=3D. That operation doesn't necessarily make =
sense
>>>>> for all containers.
>>>>>
>>>>> Billy O'Neal
>>>>> https://github.com/BillyONeal/ <https://bitbucket.org/BillyONeal/>
>>>>> http://stackoverflow.com/**users**/82320/billy-oneal<http://stackover=
flow.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>w=
rote:
>>>>>
>>>>>> In fact there is nothing new with the method append because it
>>>>>> already exists for std::basic_string. If somebody has some doubts th=
en I
>>>>>> advise to try do not use append with std::basic string and substitut=
e it
>>>>>> everywhere in code for insert. I am sure that through a month of suc=
h
>>>>>> coding he will quickly understand that method append is necessary.
>>>>>>
>>>>>> Introducing method append just makes the common interface of
>>>>>> sequential containers more consistent.
>>>>>>
>>>>>> =DE=C5=D4=D7=C5=D2=C7, 24 =CF=CB=D4=D1=C2=D2=D1 2013 =C7., 2:52:13 U=
TC+4 =D0=CF=CC=D8=DA=CF=D7=C1=D4=C5=CC=D8 Zhihao Yuan
>>>>>> =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 looked at libc++ code and I found that since the position is know=
n to be
>>>>>>> end(), append() can be implemented in a much simpler way compared w=
ith
>>>>>>> insert(). Not sure how beneficial it is though, but so far it look=
s not
>>>>>>> too useless.
>>>>>>>
>>>>>>> PS: If you agree with this rationale, I would suggest to add
>>>>>>> prepend() method to deque, list, and forward_list as well.
>>>>>>>
>>>>>> --
>>>>>>
>>>>>> ---
>>>>>> 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.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/.
--089e0160c2440d4cc704e9717a7d
Content-Type: text/html; charset=KOI8-R
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr"><div>><span style=3D"font-size:13px;font-family:arial,s=
ans-serif">It is not clear what is the return type of append.<br></span>By =
that standard, the return type of append here isn't clear either:</div>=
<div>
<span style=3D"font-family:arial,sans-serif;font-size:13px">v2.append( std:=
:next(=9Arange.second ), v1.end()=9A);</span><br></div><div><span style=3D"=
font-family:arial,sans-serif;font-size:13px"><br></span></div><div><font fa=
ce=3D"arial, sans-serif">Member-ness or nonmember-ness doesn't tell the=
caller *anything* about the return type.</font></div>
<div><font face=3D"arial, sans-serif"><br></font></div><div><font face=3D"a=
rial, sans-serif">></font><span style=3D"font-family:arial,sans-serif;fo=
nt-size:13px">can confuse users because they will think that they can use a=
ny container because the function iis a general non-member function</span><=
/div>
<div><span style=3D"font-family:arial,sans-serif;font-size:13px"><br></span=
></div><div><span style=3D"font-family:arial,sans-serif;font-size:13px">By =
that metric, any STL algorithm that requires bidirectional iterators wouldn=
't be allowed, because they don't work with input iterators. In fac=
t, advance would be a great *counter example* to your claim, because it isn=
't obvious why std::advance(std::istream_iterator( ... ), -2) wouldn=
9;t work.</span></div>
<div><span style=3D"font-family:arial,sans-serif;font-size:13px"><br></span=
></div><div><span style=3D"font-family:arial,sans-serif;font-size:13px">Use=
rs are expected to understand the function they are calling before calling =
it.</span></div>
<div class=3D"gmail_extra"><br clear=3D"all"><div><div dir=3D"ltr"><div>Bil=
ly O'Neal</div><div><a href=3D"https://bitbucket.org/BillyONeal/" targe=
t=3D"_blank">https://github.com/BillyONeal/</a></div><div><a href=3D"http:/=
/stackoverflow.com/users/82320/billy-oneal" target=3D"_blank">http://stacko=
verflow.com/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:59 PM, Vlad fr=
om Moscow <span dir=3D"ltr"><<a href=3D"mailto:vlad.moscow@mail.ru" targ=
et=3D"_blank">vlad.moscow@mail.ru</a>></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>They will think so by analogy with other similar gene=
ral functions as for example advance that can be used with any type of iter=
ators (except output iterators).</div><div><br>=DE=C5=D4=D7=C5=D2=C7, 24 =
=CF=CB=D4=D1=C2=D2=D1 2013=9A=C7., 3:57:48 UTC+4 =D0=CF=CC=D8=DA=CF=D7=C1=
=D4=C5=CC=D8 Vlad from Moscow =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"><div>In my personal opinion the=
re is two problems. It is not clear what is the return type of append. And =
such record can confuse users because they will think that they can use any=
container because the function iis a general non-member function.</div>
<div><br>=DE=C5=D4=D7=C5=D2=C7, 24 =CF=CB=D4=D1=C2=D2=D1 2013=9A=C7., 3:51:=
46 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><blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0=
px 0.8ex;padding-left:1ex;border-left-color:rgb(204,204,204);border-left-wi=
dth:1px;border-left-style:solid">
<div dir=3D"ltr">And yet, is no less clearly expressed as:<div><div style=
=3D"font-family:arial,sans-serif;font-size:13px">std::vector<int> v2(=
v1.begin(),=9Arange.first );</div><div style=3D"font-family:arial,sans-ser=
if;font-size:13px">
append( v2, std::next(=9Arange.second ), v1.end()=9A);</div></div><div styl=
e=3D"font-family:arial,sans-serif;font-size:13px"><br></div><div style=3D"f=
ont-family:arial,sans-serif;font-size:13px">which you can already do today =
without needing a standard modification.</div>
</div><div><br clear=3D"all"><div><div dir=3D"ltr"><div>Billy O'Neal</d=
iv><div><a href=3D"https://bitbucket.org/BillyONeal/" target=3D"_blank">htt=
ps://github.com/BillyONeal/</a></div><div><a href=3D"http://stackoverflow.c=
om/users/82320/billy-oneal" target=3D"_blank">http://stackoverflow.com/<u><=
/u>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:32 PM, Vlad fr=
om Moscow <span dir=3D"ltr"><<a>vlad....@mail.ru</a>></span> wrote:<b=
r><blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;paddi=
ng-left:1ex;border-left-color:rgb(204,204,204);border-left-width:1px;border=
-left-style:solid">
<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>=
=9A</div><div>To demonstrate that append looks much better than insert I wi=
ll show the following assignment.</div>
<div>=9ALet;s assume that there is a vector v1 and you need to copy=9A its =
elements in another vector v2 excluding some range that specified by a=9Apa=
ir of=9Aiterators. For example one iterator points=9Athe first negative val=
ue of the vector and the=9Asecond iterator points the last negative value o=
f the vector. The simplest way to do the assignment is to write</div>
<div>=9A</div><div>std::vector<int> v2( v1.begin(),=9Arange.first );<=
/div><div>v2.append( std::next(=9Arange.second ), v1.end()=9A);</div><div>=
=9A</div><div>That is at first the part of the original vector before the f=
irst iterator was copied and then=9Athe tail of the original vector =9Awas =
appended.. The code looks very logically and clearly due to using of append=
..</div>
<div>=9A</div><div>=9A</div><div>=9A</div><div><br>=DE=C5=D4=D7=C5=D2=C7, 2=
4 =CF=CB=D4=D1=C2=D2=D1 2013=9A=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><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><div dir=3D"ltr">Again, append makes sense for basic_string because it=
corresponds to basic_string's operator+=3D. That operation doesn't=
necessarily make sense for all containers.</div></div><div><div>
<br clear=3D"all">
<div><div dir=3D"ltr"><div>Billy O'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/<u></u>users<u></u>/82320/billy-o=
neal</a></div>
<div>Malware Response Instructor - BleepingComputer.com</div></div></div>
<br><br></div><div class=3D"gmail_quote"><div>On Wed, Oct 23, 2013 at 4:05 =
PM, Vlad from Moscow <span dir=3D"ltr"><<a>vlad....@mail.ru</a>></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>In fact there is nothing new with the method append b=
ecause it already exists for std::basic_string.=9AIf somebody has some doub=
ts then I advise to try do not use append with std::basic string and substi=
tute it everywhere in code for insert. I am sure that through a month of su=
ch coding=9Ahe will quickly understand that method append is necessary.</di=
v>
<div>=9A</div><div>Introducing method append=9Ajust makes=9Athe common inte=
rface of sequential containers more consistent.</div><div><br>=DE=C5=D4=D7=
=C5=D2=C7, 24 =CF=CB=D4=D1=C2=D2=D1 2013=9A=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:</div><blockquot=
e 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">
<p>On Oct 23, 2013 6:31 PM, "Zhihao Yuan" <<a>z...@miator.net<=
/a>> wrote:<br>
> I think we'd better not to regard this as merely a syntax sugar.=
=9A 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 =
insert().=9A 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></div><span><font color=3D"#888888"><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" 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>cpp.org/group/std-<u></u>proposals/</a>.<br>
</div></font></span></blockquote></div><br></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" group.<br>
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to <a>std-proposal...@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>
</blockquote></div></blockquote></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" 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></div>
<p></p>
-- <br />
<br />
--- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals" 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 />
--089e0160c2440d4cc704e9717a7d--
.
Author: Vlad from Moscow <vlad.moscow@mail.ru>
Date: Wed, 23 Oct 2013 17:16:38 -0700 (PDT)
Raw View
------=_Part_4424_20151755.1382573798855
Content-Type: text/plain; charset=KOI8-R
Content-Transfer-Encoding: quoted-printable
It is a bad analogy. Algorithm are some sort of tasks that have usually=20
preconditions. You can not for example use binary_search with non-ordered=
=20
sequenses. So lower_bound is not a general function as you think. It is=20
very specific function.
=20
=DE=C5=D4=D7=C5=D2=C7, 24 =CF=CB=D4=D1=C2=D2=D1 2013 =C7., 4:10:43 UTC+4 =
=D0=CF=CC=D8=DA=CF=D7=C1=D4=C5=CC=D8 Evgeny Panasyuk=20
=CE=C1=D0=C9=D3=C1=CC:
> They will think so by analogy with other similar general functions as for=
=20
>> example advance that can be used with any type of iterators (except outp=
ut=20
>> iterators).
>>
>
> Generic function does not imply that it should work for everything.=20
> std::lower_bound does not work for input iterators.std::sort works only=
=20
> for random access.
> =20
>
--=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_4424_20151755.1382573798855
Content-Type: text/html; charset=KOI8-R
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr"><div>It is a bad analogy. Algorithm are some sort of tasks=
that have usually preconditions. You can not for example use binary_search=
with non-ordered sequenses. So lower_bound is not a general function as yo=
u think. It is very specific function.</div><div> </div><div><br>=DE=
=C5=D4=D7=C5=D2=C7, 24 =CF=CB=D4=D1=C2=D2=D1 2013 =C7., 4:10:43 UTC+4 =
=D0=CF=CC=D8=DA=CF=D7=C1=D4=C5=CC=D8 Evgeny Panasyuk =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-widt=
h: 1px; border-left-style: solid;"><div dir=3D"ltr"><blockquote class=3D"gm=
ail_quote" style=3D"margin: 0px 0px 0px 0.8ex; padding-left: 1ex; border-le=
ft-color: rgb(204, 204, 204); border-left-width: 1px; border-left-style: so=
lid;"><div dir=3D"ltr"><div>They will think so by analogy with other simila=
r general functions as for example advance that can be used with any type o=
f iterators (except output iterators).</div></div></blockquote><div><br><h1=
>Generic function does not imply that it should work for everything. <br></=
h1><h1><span title=3D"namespace std">std::</span>lower_bound does not work =
for input iterators.</h1><h1>std::sort works only for random access.<br></h=
1> </div></div></blockquote></div>
<p></p>
-- <br />
<br />
--- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals" 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_4424_20151755.1382573798855--
.
Author: Vlad from Moscow <vlad.moscow@mail.ru>
Date: Wed, 23 Oct 2013 17:20:01 -0700 (PDT)
Raw View
------=_Part_4358_30840366.1382574001990
Content-Type: text/plain; charset=KOI8-R
Content-Transfer-Encoding: quoted-printable
In my opinion it is a bad analogy with algorithms. Algorithms are special=
=20
functions that have preconditions.=20
=DE=C5=D4=D7=C5=D2=C7, 24 =CF=CB=D4=D1=C2=D2=D1 2013 =C7., 4:10:55 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:
> >It is not clear what is the return type of append.
> By that standard, the return type of append here isn't clear either:
> v2.append( std::next( range.second ), v1.end() );
>
> Member-ness or nonmember-ness doesn't tell the caller *anything* about th=
e=20
> return type.
>
> >can confuse users because they will think that they can use any=20
> container because the function iis a general non-member function
>
> By that metric, any STL algorithm that requires bidirectional iterators=
=20
> wouldn't be allowed, because they don't work with input iterators. In fac=
t,=20
> advance would be a great *counter example* to your claim, because it isn'=
t=20
> obvious why std::advance(std::istream_iterator( ... ), -2) wouldn't work.
>
> Users are expected to understand the function they are calling before=20
> calling it.
>
> 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:59 PM, Vlad from Moscow <vlad....@mail.ru<javas=
cript:>
> > wrote:
>
>> They will think so by analogy with other similar general functions as fo=
r=20
>> example advance that can be used with any type of iterators (except outp=
ut=20
>> iterators).
>>
>> =DE=C5=D4=D7=C5=D2=C7, 24 =CF=CB=D4=D1=C2=D2=D1 2013 =C7., 3:57:48 UTC+4=
=D0=CF=CC=D8=DA=CF=D7=C1=D4=C5=CC=D8 Vlad from Moscow=20
>> =CE=C1=D0=C9=D3=C1=CC:
>>
>>> In my personal opinion there is two problems. It is not clear what is=
=20
>>> the return type of append. And such record can confuse users because th=
ey=20
>>> will think that they can use any container because the function iis a=
=20
>>> general non-member function.
>>>
>>> =DE=C5=D4=D7=C5=D2=C7, 24 =CF=CB=D4=D1=C2=D2=D1 2013 =C7., 3:51:46 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:
>>>
>>>> And yet, is no less clearly expressed as:
>>>> std::vector<int> v2( v1.begin(), range.first );
>>>> append( v2, std::next( range.second ), v1.end() );
>>>>
>>>> which you can already do today without needing a standard modification=
..
>>>>
>>>> Billy O'Neal
>>>> https://github.com/BillyONeal/ <https://bitbucket.org/BillyONeal/>
>>>> http://stackoverflow.com/**users/82320/billy-oneal<http://stackoverflo=
w.com/users/82320/billy-oneal>
>>>> Malware Response Instructor - BleepingComputer.com
>>>>
>>>>
>>>> On Wed, Oct 23, 2013 at 4:32 PM, Vlad from Moscow <vlad....@mail.ru>wr=
ote:
>>>>
>>>>> Billy, I do not think that append flows out of operator +=3D. It look=
s=20
>>>>> like that operator +=3D flows out of append.:)
>>>>> =20
>>>>> To demonstrate that append looks much better than insert I will show=
=20
>>>>> the following assignment.
>>>>> Let;s assume that there is a vector v1 and you need to copy its=20
>>>>> elements in another vector v2 excluding some range that specified by =
a pair=20
>>>>> of iterators. For example one iterator points the first negative valu=
e 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=20
>>>>> iterator was copied and then the tail of the original vector was=20
>>>>> appended.. The 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 UT=
C+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=
sense=20
>>>>>> for all containers.
>>>>>>
>>>>>> Billy O'Neal
>>>>>> https://github.com/BillyONeal/ <https://bitbucket.org/BillyONeal/>
>>>>>> http://stackoverflow.com/**users**/82320/billy-oneal<http://stackove=
rflow.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>=
wrote:
>>>>>>
>>>>>>> In fact there is nothing new with the method append because it=20
>>>>>>> already exists for std::basic_string. If somebody has some doubts t=
hen I=20
>>>>>>> advise to try do not use append with std::basic string and substitu=
te it=20
>>>>>>> everywhere in code for insert. I am sure that through a month of su=
ch=20
>>>>>>> coding he will quickly understand that method append is necessary.
>>>>>>> =20
>>>>>>> Introducing method append just makes the common interface of=20
>>>>>>> sequential 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.=
=20
>>>>>>>> I looked at libc++ code and I found that since the position is kno=
wn to be=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 loo=
ks not=20
>>>>>>>> too useless.
>>>>>>>>
>>>>>>>> PS: If you agree with this rationale, I would suggest to add=20
>>>>>>>> prepend() method to deque, list, and forward_list as well.
>>>>>>>>
>>>>>>> --=20
>>>>>>> =20
>>>>>>> ---=20
>>>>>>> You received this message because you are subscribed to the Google=
=20
>>>>>>> Groups "ISO C++ Standard - Future Proposals" group.
>>>>>>> To unsubscribe from this group and stop receiving emails from it,=
=20
>>>>>>> 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/>
>>>>>>> .
>>>>>>>
>>>>>>
>>>>>> --=20
>>>>> =20
>>>>> ---=20
>>>>> You received this message because you are subscribed to the Google=20
>>>>> Groups "ISO C++ Standard - Future Proposals" group.
>>>>> To unsubscribe from this group and stop receiving emails from it, sen=
d=20
>>>>> 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-proposal=
s/>
>>>>> .
>>>>>
>>>>
>>>> --=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_4358_30840366.1382574001990
Content-Type: text/html; charset=KOI8-R
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr"><div>In my opinion it is a bad analogy with algorithms. Al=
gorithms are special functions that have preconditions. </div><div><br>=DE=
=C5=D4=D7=C5=D2=C7, 24 =CF=CB=D4=D1=C2=D2=D1 2013 =C7., 4:10:55 UTC+4 =
=D0=CF=CC=D8=DA=CF=D7=C1=D4=C5=CC=D8 Billy O'Neal =CE=C1=D0=C9=D3=C1=CC:</d=
iv><blockquote class=3D"gmail_quote" style=3D"margin: 0px 0px 0px 0.8ex; pa=
dding-left: 1ex; border-left-color: rgb(204, 204, 204); border-left-width: =
1px; border-left-style: solid;"><div dir=3D"ltr"><div>><span style=3D"fo=
nt-family: arial,sans-serif; font-size: 13px;">It is not clear what is the =
return type of append.<br></span>By that standard, the return type of appen=
d here isn't clear either:</div><div>
<span style=3D"font-family: arial,sans-serif; font-size: 13px;">v2.append( =
std::next( range.second ), v1.end() );</span><br></div><div><span=
style=3D"font-family: arial,sans-serif; font-size: 13px;"><br></span></div=
><div><font face=3D"arial, sans-serif">Member-ness or nonmember-ness doesn'=
t tell the caller *anything* about the return type.</font></div>
<div><font face=3D"arial, sans-serif"><br></font></div><div><font face=3D"a=
rial, sans-serif">></font><span style=3D"font-family: arial,sans-serif; =
font-size: 13px;">can confuse users because they will think that they can u=
se any container because the function iis a general non-member function</sp=
an></div>
<div><span style=3D"font-family: arial,sans-serif; font-size: 13px;"><br></=
span></div><div><span style=3D"font-family: arial,sans-serif; font-size: 13=
px;">By that metric, any STL algorithm that requires bidirectional iterator=
s wouldn't be allowed, because they don't work with input iterators. In fac=
t, advance would be a great *counter example* to your claim, because it isn=
't obvious why std::advance(std::istream_<wbr>iterator( ... ), -2) wouldn't=
work.</span></div>
<div><span style=3D"font-family: arial,sans-serif; font-size: 13px;"><br></=
span></div><div><span style=3D"font-family: arial,sans-serif; font-size: 13=
px;">Users are expected to understand the function they are calling before =
calling it.</span></div>
<div><br clear=3D"all"><div><div dir=3D"ltr"><div>Billy O'Neal</div><div><a=
href=3D"https://bitbucket.org/BillyONeal/" target=3D"_blank">https://githu=
b.com/BillyONeal/</a></div><div><a href=3D"http://stackoverflow.com/users/8=
2320/billy-oneal" target=3D"_blank">http://stackoverflow.com/<wbr>users/823=
20/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:59 PM, Vlad fr=
om Moscow <span dir=3D"ltr"><<a href=3D"javascript:" target=3D"_blank" g=
df-obfuscated-mailto=3D"IZ7V_2VFJKsJ">vlad....@mail.ru</a>></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>They will think so by analogy with other similar gene=
ral functions as for example advance that can be used with any type of iter=
ators (except output iterators).</div><div><br>=DE=C5=D4=D7=C5=D2=C7, 24 =
=CF=CB=D4=D1=C2=D2=D1 2013 =C7., 3:57:48 UTC+4 =D0=CF=CC=D8=DA=CF=D7=
=C1=D4=C5=CC=D8 Vlad from Moscow =CE=C1=D0=C9=D3=C1=CC:</div>
<div><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-left-style: solid;"><div dir=3D"ltr"><div>In my personal=
opinion there is two problems. It is not clear what is the return type of =
append. And such record can confuse users because they will think that they=
can use any container because the function iis a general non-member functi=
on.</div>
<div><br>=DE=C5=D4=D7=C5=D2=C7, 24 =CF=CB=D4=D1=C2=D2=D1 2013 =C7., 3:=
51:46 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><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">And yet, is no less clearly expressed as:<div><div style=
=3D"font-family: arial,sans-serif; font-size: 13px;">std::vector<int>=
v2( v1.begin(), range.first );</div><div style=3D"font-family: arial,=
sans-serif; font-size: 13px;">
append( v2, std::next( range.second ), v1.end() );</div></div><di=
v style=3D"font-family: arial,sans-serif; font-size: 13px;"><br></div><div =
style=3D"font-family: arial,sans-serif; font-size: 13px;">which you can alr=
eady do today without needing a standard modification.</div>
</div><div><br clear=3D"all"><div><div dir=3D"ltr"><div>Billy O'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/u=
sers/82320/billy-oneal" target=3D"_blank">http://stackoverflow.com/<u></u>u=
sers<wbr>/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:32 PM, Vlad fr=
om Moscow <span dir=3D"ltr"><<a>vlad....@mail.ru</a>></span> wrote:<b=
r><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;">
<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>=
</div><div>To demonstrate that append looks much better than insert I=
will show the following assignment.</div>
<div> Let;s assume that there is a vector v1 and you need to copy =
; its elements in another vector v2 excluding some range that specified by =
a pair of iterators. For example one iterator points the fir=
st negative value of the vector and the second iterator points the las=
t negative value of the vector. The simplest way to do the assignment is to=
write</div>
<div> </div><div>std::vector<int> v2( v1.begin(), range.fir=
st );</div><div>v2.append( std::next( range.second ), v1.end() );=
</div><div> </div><div>That is at first the part of the original vecto=
r before the first iterator was copied and then the tail of the origin=
al vector was appended.. The code looks very logically and clearly du=
e to using of append.</div>
<div> </div><div> </div><div> </div><div><br>=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 =CE=C1=D0=C9=D3=C1=CC:</div><blockquo=
te 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><div dir=3D"ltr">Again, append makes sense for basic_string because it=
corresponds to basic_string's operator+=3D. That operation doesn't necessa=
rily make sense for all containers.</div></div><div><div>
<br clear=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/<u></u>users<u></u><wbr>/82320/billy-=
oneal</a></div>
<div>Malware Response Instructor - BleepingComputer.com</div></div></div>
<br><br></div><div class=3D"gmail_quote"><div>On Wed, Oct 23, 2013 at 4:05 =
PM, Vlad from Moscow <span dir=3D"ltr"><<a>vlad....@mail.ru</a>></spa=
n> wrote:<br></div><blockquote class=3D"gmail_quote" style=3D"margin: 0px 0=
px 0px 0.8ex; padding-left: 1ex; border-left-color: rgb(204, 204, 204); bor=
der-left-width: 1px; border-left-style: solid;">
<div>
<div dir=3D"ltr"><div>In fact there is nothing new with the method append b=
ecause it already exists for std::basic_string. 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 he will quickly understand that method append is necessar=
y.</div>
<div> </div><div>Introducing method append just makes 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 =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" <<a>z...@miator.net</a>> wr=
ote:<br>
> I think we'd better not to regard this as merely a syntax sugar. =
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(). 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></div><span><font color=3D"#888888"><div>
<p></p>
-- <br>
<br>
--- <br>
You received this message because you are subscribed to the Google Groups "=
ISO C++ Standard - Future Proposals" 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><wbr>cpp.org/group/std-<u></u>proposals/</a>.<br>
</div></font></span></blockquote></div><br></div>
</blockquote></div><div><div>
<p></p>
-- <br>
<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>std-proposal...@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<wbr=
>cpp.org/group/std-<u></u>proposals/</a>.<br>
</div></div></blockquote></div><br></div>
</blockquote></div></blockquote></div></div></div><div><div>
<p></p>
-- <br>
<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"=
IZ7V_2VFJKsJ">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"IZ7V_2VFJKsJ">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>
</div></div></blockquote></div><br></div></div>
</blockquote></div>
<p></p>
-- <br />
<br />
--- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals" 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_4358_30840366.1382574001990--
.
Author: "Billy O'Neal" <billy.oneal@gmail.com>
Date: Wed, 23 Oct 2013 17:35:47 -0700
Raw View
--001a11c24a5203ad0e04e971d3ca
Content-Type: text/plain; charset=KOI8-R
Content-Transfer-Encoding: quoted-printable
Erm, I didn't bring up algorithms, you did. (Your example was std::advance)
And there's nothing special about them. All functions have preconditions.
You can take any old C API and show preconditions. For example:
std::string s;
std::abs(s); // Compiler error
Append is no different.
More to the point, even the member append on basic_string has
preconditions. For instance, in the overload of append taking an iterator
range, the preconditions are that the parameters are in fact an iterator
range. Which comes with all sorts of implied conditions which can't be
checked at compile time. (E.g. the iterators must point to the same source
range)
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 5:20 PM, Vlad from Moscow <vlad.moscow@mail.ru>wrot=
e:
> In my opinion it is a bad analogy with algorithms. Algorithms are special
> functions that have preconditions.
>
> =DE=C5=D4=D7=C5=D2=C7, 24 =CF=CB=D4=D1=C2=D2=D1 2013 =C7., 4:10:55 UTC+4 =
=D0=CF=CC=D8=DA=CF=D7=C1=D4=C5=CC=D8 Billy O'Neal
> =CE=C1=D0=C9=D3=C1=CC:
>
>> >It is not clear what is the return type of append.
>> By that standard, the return type of append here isn't clear either:
>> v2.append( std::next( range.second ), v1.end() );
>>
>> Member-ness or nonmember-ness doesn't tell the caller *anything* about
>> the return type.
>>
>> >can confuse users because they will think that they can use any
>> container because the function iis a general non-member function
>>
>> By that metric, any STL algorithm that requires bidirectional iterators
>> wouldn't be allowed, because they don't work with input iterators. In fa=
ct,
>> advance would be a great *counter example* to your claim, because it isn=
't
>> obvious why std::advance(std::istream_**iterator( ... ), -2) wouldn't
>> work.
>>
>> Users are expected to understand the function they are calling before
>> calling it.
>>
>> 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 Wed, Oct 23, 2013 at 4:59 PM, Vlad from Moscow <vlad....@mail.ru>wrot=
e:
>>
>>> They will think so by analogy with other similar general functions as
>>> for example advance that can be used with any type of iterators (except
>>> output iterators).
>>>
>>> =DE=C5=D4=D7=C5=D2=C7, 24 =CF=CB=D4=D1=C2=D2=D1 2013 =C7., 3:57:48 UTC+=
4 =D0=CF=CC=D8=DA=CF=D7=C1=D4=C5=CC=D8 Vlad from Moscow
>>> =CE=C1=D0=C9=D3=C1=CC:
>>>
>>>> In my personal opinion there is two problems. It is not clear what is
>>>> the return type of append. And such record can confuse users because t=
hey
>>>> will think that they can use any container because the function iis a
>>>> general non-member function.
>>>>
>>>> =DE=C5=D4=D7=C5=D2=C7, 24 =CF=CB=D4=D1=C2=D2=D1 2013 =C7., 3:51:46 UTC=
+4 =D0=CF=CC=D8=DA=CF=D7=C1=D4=C5=CC=D8 Billy O'Neal
>>>> =CE=C1=D0=C9=D3=C1=CC:
>>>>
>>>>> And yet, is no less clearly expressed as:
>>>>> std::vector<int> v2( v1.begin(), range.first );
>>>>> append( v2, std::next( range.second ), v1.end() );
>>>>>
>>>>> which you can already do today without needing a standard modificatio=
n.
>>>>>
>>>>> Billy O'Neal
>>>>> https://github.com/BillyONeal/ <https://bitbucket.org/BillyONeal/>
>>>>> http://stackoverflow.com/**users**/82320/billy-oneal<http://stackover=
flow.com/users/82320/billy-oneal>
>>>>> Malware Response Instructor - BleepingComputer.com
>>>>>
>>>>>
>>>>> On Wed, Oct 23, 2013 at 4:32 PM, Vlad from Moscow <vlad....@mail.ru>w=
rote:
>>>>>
>>>>>> Billy, I do not think that append flows out of operator +=3D. It loo=
ks
>>>>>> like that operator +=3D flows out of append.:)
>>>>>>
>>>>>> To demonstrate that append looks much better than insert I will show
>>>>>> the following assignment.
>>>>>> Let;s assume that there is a vector v1 and you need to copy its
>>>>>> elements in another vector v2 excluding some range that specified by=
a pair
>>>>>> of iterators. For example one iterator points the first negative val=
ue of
>>>>>> the vector and the second iterator points the last negative value of=
the
>>>>>> vector. The simplest way to do the assignment is to write
>>>>>>
>>>>>> std::vector<int> v2( v1.begin(), range.first );
>>>>>> v2.append( std::next( range.second ), v1.end() );
>>>>>>
>>>>>> That is at first the part of the original vector before the first
>>>>>> iterator was copied and then the tail of the original vector was
>>>>>> appended.. The code looks very logically and clearly due to using of=
append.
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>> =DE=C5=D4=D7=C5=D2=C7, 24 =CF=CB=D4=D1=C2=D2=D1 2013 =C7., 3:07:04 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:
>>>>>>
>>>>>>> Again, append makes sense for basic_string because it corresponds t=
o
>>>>>>> basic_string's operator+=3D. That operation doesn't necessarily mak=
e sense
>>>>>>> for all containers.
>>>>>>>
>>>>>>> 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 Wed, Oct 23, 2013 at 4:05 PM, Vlad from Moscow <vlad....@mail.ru=
>wrote:
>>>>>>>
>>>>>>>> In fact there is nothing new with the method append because it
>>>>>>>> already exists for std::basic_string. If somebody has some doubts =
then I
>>>>>>>> advise to try do not use append with std::basic string and substit=
ute it
>>>>>>>> everywhere in code for insert. I am sure that through a month of s=
uch
>>>>>>>> coding he will quickly understand that method append is necessary.
>>>>>>>>
>>>>>>>> Introducing method append just makes the common interface of
>>>>>>>> sequential 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
>>>>>>>> =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 looked at libc++ code and I found that since the positi=
on is
>>>>>>>>> known to be end(), append() can be implemented in a much simpler =
way
>>>>>>>>> compared with insert(). Not sure how beneficial it is though, bu=
t so far
>>>>>>>>> it looks not too useless.
>>>>>>>>>
>>>>>>>>> PS: If you agree with this rationale, I would suggest to add
>>>>>>>>> prepend() method to deque, list, and forward_list as well.
>>>>>>>>>
>>>>>>>> --
>>>>>>>>
>>>>>>>> ---
>>>>>>>> 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.o=
rg/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/**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/.
--001a11c24a5203ad0e04e971d3ca
Content-Type: text/html; charset=KOI8-R
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr"><div>Erm, I didn't bring up algorithms, you did. (Your=
example was std::advance) And there's nothing special about them. All =
functions have preconditions. You can take any old C API and show precondit=
ions. For example:</div>
<div>=9A</div><div>std::string s;</div><div>std::abs(s); // Compiler error<=
/div><div>=9A</div><div>Append is no different.</div><div>=9A</div><div>Mor=
e to the point, even the member append on basic_string has preconditions. F=
or instance, in the overload of append taking an iterator range, the precon=
ditions are that the parameters are in fact an iterator range. Which comes =
with all sorts of implied conditions which can't be checked at compile =
time. (E.g. the iterators must point to the same source range)</div>
</div><div class=3D"gmail_extra"><br clear=3D"all"><div><div dir=3D"ltr"><d=
iv>Billy O'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"_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 Wed, Oct 23, 2013 at 5:20 PM, Vlad fr=
om Moscow <span dir=3D"ltr"><<a href=3D"mailto:vlad.moscow@mail.ru" targ=
et=3D"_blank">vlad.moscow@mail.ru</a>></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>In my opinion it is a bad analogy with algorithms. Al=
gorithms are special functions that have preconditions. </div><div><br>=DE=
=C5=D4=D7=C5=D2=C7, 24 =CF=CB=D4=D1=C2=D2=D1 2013=9A=C7., 4:10:55 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>
<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 dir=3D"ltr"><div class=3D"im"><div>><span style=3D=
"font-family:arial,sans-serif;font-size:13px">It is not clear what is the r=
eturn type of append.<br>
</span>By that standard, the return type of append here isn't clear eit=
her:</div><div>
<span style=3D"font-family:arial,sans-serif;font-size:13px">v2.append( std:=
:next(=9Arange.second ), v1.end()=9A);</span><br></div><div><span style=3D"=
font-family:arial,sans-serif;font-size:13px"><br></span></div><div><font fa=
ce=3D"arial, sans-serif">Member-ness or nonmember-ness doesn't tell the=
caller *anything* about the return type.</font></div>
<div><font face=3D"arial, sans-serif"><br></font></div><div><font face=3D"a=
rial, sans-serif">></font><span style=3D"font-family:arial,sans-serif;fo=
nt-size:13px">can confuse users because they will think that they can use a=
ny container because the function iis a general non-member function</span><=
/div>
<div><span style=3D"font-family:arial,sans-serif;font-size:13px"><br></span=
></div><div><span style=3D"font-family:arial,sans-serif;font-size:13px">By =
that metric, any STL algorithm that requires bidirectional iterators wouldn=
't be allowed, because they don't work with input iterators. In fac=
t, advance would be a great *counter example* to your claim, because it isn=
't obvious why std::advance(std::istream_<u></u>iterator( ... ), -2) wo=
uldn't work.</span></div>
<div><span style=3D"font-family:arial,sans-serif;font-size:13px"><br></span=
></div><div><span style=3D"font-family:arial,sans-serif;font-size:13px">Use=
rs are expected to understand the function they are calling before calling =
it.</span></div>
</div><div><div class=3D"im"><br clear=3D"all"><div><div dir=3D"ltr"><div>B=
illy O'Neal</div><div><a href=3D"https://bitbucket.org/BillyONeal/" tar=
get=3D"_blank">https://github.com/BillyONeal/</a></div><div><a href=3D"http=
://stackoverflow.com/users/82320/billy-oneal" target=3D"_blank">http://stac=
koverflow.com/<u></u>users/82320/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 Wed, Oct=
23, 2013 at 4:59 PM, Vlad from Moscow <span dir=3D"ltr"><<a>vlad....@ma=
il.ru</a>></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>They will think so by analogy with other similar gene=
ral functions as for example advance that can be used with any type of iter=
ators (except output iterators).</div><div><br>=DE=C5=D4=D7=C5=D2=C7, 24 =
=CF=CB=D4=D1=C2=D2=D1 2013=9A=C7., 3:57:48 UTC+4 =D0=CF=CC=D8=DA=CF=D7=C1=
=D4=C5=CC=D8 Vlad from Moscow =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"><div>In my personal opinion the=
re is two problems. It is not clear what is the return type of append. And =
such record can confuse users because they will think that they can use any=
container because the function iis a general non-member function.</div>
<div><br>=DE=C5=D4=D7=C5=D2=C7, 24 =CF=CB=D4=D1=C2=D2=D1 2013=9A=C7., 3:51:=
46 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><blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0=
px 0.8ex;padding-left:1ex;border-left-color:rgb(204,204,204);border-left-wi=
dth:1px;border-left-style:solid">
<div dir=3D"ltr">And yet, is no less clearly expressed as:<div><div style=
=3D"font-family:arial,sans-serif;font-size:13px">std::vector<int> v2(=
v1.begin(),=9Arange.first );</div><div style=3D"font-family:arial,sans-ser=
if;font-size:13px">
append( v2, std::next(=9Arange.second ), v1.end()=9A);</div></div><div styl=
e=3D"font-family:arial,sans-serif;font-size:13px"><br></div><div style=3D"f=
ont-family:arial,sans-serif;font-size:13px">which you can already do today =
without needing a standard modification.</div>
</div><div><br clear=3D"all"><div><div dir=3D"ltr"><div>Billy O'Neal</d=
iv><div><a href=3D"https://bitbucket.org/BillyONeal/" target=3D"_blank">htt=
ps://github.com/BillyONeal/</a></div><div><a href=3D"http://stackoverflow.c=
om/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 class=3D"gmail_quote">On Wed, Oct 23, 2013 at 4:32 PM, Vlad fr=
om Moscow <span dir=3D"ltr"><<a>vlad....@mail.ru</a>></span> wrote:<b=
r><blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;paddi=
ng-left:1ex;border-left-color:rgb(204,204,204);border-left-width:1px;border=
-left-style:solid">
<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>=
=9A</div><div>To demonstrate that append looks much better than insert I wi=
ll show the following assignment.</div>
<div>=9ALet;s assume that there is a vector v1 and you need to copy=9A its =
elements in another vector v2 excluding some range that specified by a=9Apa=
ir of=9Aiterators. For example one iterator points=9Athe first negative val=
ue of the vector and the=9Asecond iterator points the last negative value o=
f the vector. The simplest way to do the assignment is to write</div>
<div>=9A</div><div>std::vector<int> v2( v1.begin(),=9Arange.first );<=
/div><div>v2.append( std::next(=9Arange.second ), v1.end()=9A);</div><div>=
=9A</div><div>That is at first the part of the original vector before the f=
irst iterator was copied and then=9Athe tail of the original vector =9Awas =
appended.. The code looks very logically and clearly due to using of append=
..</div>
<div>=9A</div><div>=9A</div><div>=9A</div><div><br>=DE=C5=D4=D7=C5=D2=C7, 2=
4 =CF=CB=D4=D1=C2=D2=D1 2013=9A=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><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><div dir=3D"ltr">Again, append makes sense for basic_string because it=
corresponds to basic_string's operator+=3D. That operation doesn't=
necessarily make sense for all containers.</div></div><div><div>
<br clear=3D"all">
<div><div dir=3D"ltr"><div>Billy O'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/<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 Wed, Oct 23, 2013 at 4:05 =
PM, Vlad from Moscow <span dir=3D"ltr"><<a>vlad....@mail.ru</a>></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>In fact there is nothing new with the method append b=
ecause it already exists for std::basic_string.=9AIf somebody has some doub=
ts then I advise to try do not use append with std::basic string and substi=
tute it everywhere in code for insert. I am sure that through a month of su=
ch coding=9Ahe will quickly understand that method append is necessary.</di=
v>
<div>=9A</div><div>Introducing method append=9Ajust makes=9Athe common inte=
rface of sequential containers more consistent.</div><div><br>=DE=C5=D4=D7=
=C5=D2=C7, 24 =CF=CB=D4=D1=C2=D2=D1 2013=9A=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:</div><blockquot=
e 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">
<p>On Oct 23, 2013 6:31 PM, "Zhihao Yuan" <<a>z...@miator.net<=
/a>> wrote:<br>
> I think we'd better not to regard this as merely a syntax sugar.=
=9A 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 =
insert().=9A 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></div><span><font color=3D"#888888"><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" 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></font></span></blockquote></div><br></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" group.<br>
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to <a>std-proposal...@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>
</blockquote></div></blockquote></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" 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></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" 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 />
<br />
--- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals" 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 />
--001a11c24a5203ad0e04e971d3ca--
.
Author: Vlad from Moscow <vlad.moscow@mail.ru>
Date: Thu, 24 Oct 2013 01:16:15 -0700 (PDT)
Raw View
------=_Part_2369_29821266.1382602575389
Content-Type: text/plain; charset=KOI8-R
Content-Transfer-Encoding: quoted-printable
To make function append a non-member function in my opinion is simply a=20
bad idea.=20
In fact in this case inside the function you will call method insert=20
because there is no other possibility in this design. So it is not=20
effective. Moreover this design only confuses users because you must list=
=20
those containers that can be used with this function. I understand that it=
=20
can be a new silly question in interview: list the containers that can be=
=20
used with this function and with that frunction.
It is a very poor design. And when methods will be chained together it=20
will lagain look badly: a mix of member and non-member functions.
I
=DE=C5=D4=D7=C5=D2=C7, 24 =CF=CB=D4=D1=C2=D2=D1 2013 =C7., 4:35:47 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:
> Erm, I didn't bring up algorithms, you did. (Your example was=20
> std::advance) And there's nothing special about them. All functions have=
=20
> preconditions. You can take any old C API and show preconditions. For=20
> example:
> =20
> std::string s;
> std::abs(s); // Compiler error
> =20
> Append is no different.
> =20
> More to the point, even the member append on basic_string has=20
> preconditions. For instance, in the overload of append taking an iterator=
=20
> range, the preconditions are that the parameters are in fact an iterator=
=20
> range. Which comes with all sorts of implied conditions which can't be=20
> checked at compile time. (E.g. the iterators must point to the same sourc=
e=20
> range)
>
> 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 5:20 PM, Vlad from Moscow <vlad....@mail.ru<javas=
cript:>
> > wrote:
>
>> In my opinion it is a bad analogy with algorithms. Algorithms are specia=
l=20
>> functions that have preconditions.=20
>>
>> =DE=C5=D4=D7=C5=D2=C7, 24 =CF=CB=D4=D1=C2=D2=D1 2013 =C7., 4:10:55 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:
>>
>>> >It is not clear what is the return type of append.
>>> By that standard, the return type of append here isn't clear either:
>>> v2.append( std::next( range.second ), v1.end() );
>>>
>>> Member-ness or nonmember-ness doesn't tell the caller *anything* about=
=20
>>> the return type.
>>>
>>> >can confuse users because they will think that they can use any=20
>>> container because the function iis a general non-member function
>>>
>>> By that metric, any STL algorithm that requires bidirectional iterators=
=20
>>> wouldn't be allowed, because they don't work with input iterators. In f=
act,=20
>>> advance would be a great *counter example* to your claim, because it is=
n't=20
>>> obvious why std::advance(std::istream_**iterator( ... ), -2) wouldn't=
=20
>>> work.
>>>
>>> Users are expected to understand the function they are calling before=
=20
>>> calling it.
>>>
>>> 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 Wed, Oct 23, 2013 at 4:59 PM, Vlad from Moscow <vlad....@mail.ru>wro=
te:
>>>
>>>> They will think so by analogy with other similar general functions as=
=20
>>>> for example advance that can be used with any type of iterators (excep=
t=20
>>>> output iterators).
>>>>
>>>> =DE=C5=D4=D7=C5=D2=C7, 24 =CF=CB=D4=D1=C2=D2=D1 2013 =C7., 3:57:48 UTC=
+4 =D0=CF=CC=D8=DA=CF=D7=C1=D4=C5=CC=D8 Vlad from=20
>>>> Moscow =CE=C1=D0=C9=D3=C1=CC:
>>>>
>>>>> In my personal opinion there is two problems. It is not clear what is=
=20
>>>>> the return type of append. And such record can confuse users because =
they=20
>>>>> will think that they can use any container because the function iis a=
=20
>>>>> general non-member function.
>>>>>
>>>>> =DE=C5=D4=D7=C5=D2=C7, 24 =CF=CB=D4=D1=C2=D2=D1 2013 =C7., 3:51:46 UT=
C+4 =D0=CF=CC=D8=DA=CF=D7=C1=D4=C5=CC=D8 Billy O'Neal=20
>>>>> =CE=C1=D0=C9=D3=C1=CC:
>>>>>
>>>>>> And yet, is no less clearly expressed as:
>>>>>> std::vector<int> v2( v1.begin(), range.first );
>>>>>> append( v2, std::next( range.second ), v1.end() );
>>>>>>
>>>>>> which you can already do today without needing a standard=20
>>>>>> modification.
>>>>>>
>>>>>> Billy O'Neal
>>>>>> https://github.com/BillyONeal/ <https://bitbucket.org/BillyONeal/>
>>>>>> http://stackoverflow.com/**users**/82320/billy-oneal<http://stackove=
rflow.com/users/82320/billy-oneal>
>>>>>> Malware Response Instructor - BleepingComputer.com
>>>>>>
>>>>>>
>>>>>> On Wed, Oct 23, 2013 at 4:32 PM, Vlad from Moscow <vlad....@mail.ru>=
wrote:
>>>>>>
>>>>>>> Billy, I do not think that append flows out of operator +=3D. It lo=
oks=20
>>>>>>> like that operator +=3D flows out of append.:)
>>>>>>> =20
>>>>>>> To demonstrate that append looks much better than insert I will sho=
w=20
>>>>>>> the following assignment.
>>>>>>> Let;s assume that there is a vector v1 and you need to copy its=
=20
>>>>>>> elements in another vector v2 excluding some range that specified b=
y a pair=20
>>>>>>> of iterators. For example one iterator points the first negative va=
lue of=20
>>>>>>> the vector and the second iterator points the last negative value o=
f 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=
=20
>>>>>>> iterator was copied and then the tail of the original vector was=
=20
>>>>>>> appended.. The code looks very logically and clearly due to using o=
f 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=
=20
>>>>>>>> to basic_string's operator+=3D. That operation doesn't necessarily=
make sense=20
>>>>>>>> for all containers.
>>>>>>>>
>>>>>>>> Billy O'Neal
>>>>>>>> https://github.com/BillyONeal/ <https://bitbucket.org/BillyONeal/>
>>>>>>>> http://stackoverflow.com/**users****/82320/billy-oneal<http://stac=
koverflow.com/users/82320/billy-oneal>
>>>>>>>> Malware Response Instructor - BleepingComputer.com
>>>>>>>>
>>>>>>>>
>>>>>>>> On Wed, Oct 23, 2013 at 4:05 PM, Vlad from Moscow <vlad....@mail.r=
u
>>>>>>>> > wrote:
>>>>>>>>
>>>>>>>>> In fact there is nothing new with the method append because it=
=20
>>>>>>>>> already exists for std::basic_string. If somebody has some doubts=
then I=20
>>>>>>>>> advise to try do not use append with std::basic string and substi=
tute it=20
>>>>>>>>> everywhere in code for insert. I am sure that through a month of =
such=20
>>>>>>>>> coding he will quickly understand that method append is necessary=
..
>>>>>>>>> =20
>>>>>>>>> Introducing method append just makes the common interface of=20
>>>>>>>>> sequential containers more consistent.
>>>>>>>>>
>>>>>>>>> =DE=C5=D4=D7=C5=D2=C7, 24 =CF=CB=D4=D1=C2=D2=D1 2013 =C7., 2:52:1=
3 UTC+4 =D0=CF=CC=D8=DA=CF=D7=C1=D4=C5=CC=D8 Zhihao=20
>>>>>>>>> Yuan =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=20
>>>>>>>>>> sugar. I looked at libc++ code and I found that since the posit=
ion is=20
>>>>>>>>>> known to be end(), append() can be implemented in a much simpler=
way=20
>>>>>>>>>> compared with insert(). Not sure how beneficial it is though, b=
ut so far=20
>>>>>>>>>> it looks not too useless.
>>>>>>>>>>
>>>>>>>>>> PS: If you agree with this rationale, I would suggest to add=20
>>>>>>>>>> prepend() method to deque, list, and forward_list as well.
>>>>>>>>>>
>>>>>>>>> --=20
>>>>>>>>> =20
>>>>>>>>> ---=20
>>>>>>>>> You received this message because you are subscribed to the Googl=
e=20
>>>>>>>>> Groups "ISO C++ Standard - Future Proposals" group.
>>>>>>>>> To unsubscribe from this group and stop receiving emails from it,=
=20
>>>>>>>>> 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.=
org/group/std-proposals/>
>>>>>>>>> .
>>>>>>>>>
>>>>>>>>
>>>>>>>> --=20
>>>>>>> =20
>>>>>>> ---=20
>>>>>>> You received this message because you are subscribed to the Google=
=20
>>>>>>> Groups "ISO C++ Standard - Future Proposals" group.
>>>>>>> To unsubscribe from this group and stop receiving emails from it,=
=20
>>>>>>> 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/>
>>>>>>> .
>>>>>>>
>>>>>>
>>>>>> --=20
>>>> =20
>>>> ---=20
>>>> You received this message because you are subscribed to the Google=20
>>>> Groups "ISO C++ Standard - Future Proposals" group.
>>>> To unsubscribe from this group and stop receiving emails from it, send=
=20
>>>> 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/=
>
>>>> .
>>>>
>>>
>>> --=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_2369_29821266.1382602575389
Content-Type: text/html; charset=KOI8-R
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr"><div>To make function append a non-member function in my o=
pinion is simply a bad idea. </div><div>In fact in this case inside t=
he function you will call method insert because there is no other possibili=
ty in this design. So it is not effective. Moreover this design only confus=
es users because you must list those containers that can be used with this =
function. I understand that it can be a new silly question in interview: li=
st the containers that can be used with this function and with th=
at frunction.</div><div> It is a very poor design. And when methods wi=
ll be chained together it will lagain look badly: a mix of member and non-m=
ember functions.</div><div>I</div><div><br>=DE=C5=D4=D7=C5=D2=C7, 24 =CF=CB=
=D4=D1=C2=D2=D1 2013 =C7., 4:35:47 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><blockquote class=3D"gma=
il_quote" style=3D"margin: 0px 0px 0px 0.8ex; padding-left: 1ex; border-lef=
t-color: rgb(204, 204, 204); border-left-width: 1px; border-left-style: sol=
id;"><div dir=3D"ltr"><div>Erm, I didn't bring up algorithms, you did. (You=
r example was std::advance) And there's nothing special about them. All fun=
ctions have preconditions. You can take any old C API and show precondition=
s. For example:</div>
<div> </div><div>std::string s;</div><div>std::abs(s); // Compiler err=
or</div><div> </div><div>Append is no different.</div><div> </div=
><div>More to the point, even the member append on basic_string has precond=
itions. For instance, in the overload of append taking an iterator range, t=
he preconditions are that the parameters are in fact an iterator range. Whi=
ch comes with all sorts of implied conditions which can't be checked at com=
pile time. (E.g. the iterators must point to the same source range)</div>
</div><div><br clear=3D"all"><div><div dir=3D"ltr"><div>Billy O'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/u=
sers/82320/billy-oneal" target=3D"_blank">http://stackoverflow.com/<wbr>use=
rs/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 5:20 PM, Vlad fr=
om Moscow <span dir=3D"ltr"><<a href=3D"javascript:" target=3D"_blank" g=
df-obfuscated-mailto=3D"yDZZdeOJ3UkJ">vlad....@mail.ru</a>></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 my opinion it is a bad analogy with algorithms. Al=
gorithms are special functions that have preconditions. </div><div><br>=DE=
=C5=D4=D7=C5=D2=C7, 24 =CF=CB=D4=D1=C2=D2=D1 2013 =C7., 4:10:55 UTC+4 =
=D0=CF=CC=D8=DA=CF=D7=C1=D4=C5=CC=D8 Billy O'Neal =CE=C1=D0=C9=D3=C1=CC:</d=
iv>
<blockquote class=3D"gmail_quote" style=3D"margin: 0px 0px 0px 0.8ex; paddi=
ng-left: 1ex; border-left-color: rgb(204, 204, 204); border-left-width: 1px=
; border-left-style: solid;"><div dir=3D"ltr"><div><div>><span style=3D"=
font-family: arial,sans-serif; font-size: 13px;">It is not clear what is th=
e return type of append.<br>
</span>By that standard, the return type of append here isn't clear either:=
</div><div>
<span style=3D"font-family: arial,sans-serif; font-size: 13px;">v2.append( =
std::next( range.second ), v1.end() );</span><br></div><div><span=
style=3D"font-family: arial,sans-serif; font-size: 13px;"><br></span></div=
><div><font face=3D"arial, sans-serif">Member-ness or nonmember-ness doesn'=
t tell the caller *anything* about the return type.</font></div>
<div><font face=3D"arial, sans-serif"><br></font></div><div><font face=3D"a=
rial, sans-serif">></font><span style=3D"font-family: arial,sans-serif; =
font-size: 13px;">can confuse users because they will think that they can u=
se any container because the function iis a general non-member function</sp=
an></div>
<div><span style=3D"font-family: arial,sans-serif; font-size: 13px;"><br></=
span></div><div><span style=3D"font-family: arial,sans-serif; font-size: 13=
px;">By that metric, any STL algorithm that requires bidirectional iterator=
s wouldn't be allowed, because they don't work with input iterators. In fac=
t, advance would be a great *counter example* to your claim, because it isn=
't obvious why std::advance(std::istream_<u></u>iter<wbr>ator( ... ), -2) w=
ouldn't work.</span></div>
<div><span style=3D"font-family: arial,sans-serif; font-size: 13px;"><br></=
span></div><div><span style=3D"font-family: arial,sans-serif; font-size: 13=
px;">Users are expected to understand the function they are calling before =
calling it.</span></div>
</div><div><div><br clear=3D"all"><div><div dir=3D"ltr"><div>Billy O'Neal</=
div><div><a href=3D"https://bitbucket.org/BillyONeal/" target=3D"_blank">ht=
tps://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<wbr>/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 Wed, Oct 23, 2013 at =
4:59 PM, Vlad from Moscow <span dir=3D"ltr"><<a>vlad....@mail.ru</a>>=
</span> wrote:<br><blockquote class=3D"gmail_quote" style=3D"margin: 0px 0p=
x 0px 0.8ex; padding-left: 1ex; border-left-color: rgb(204, 204, 204); bord=
er-left-width: 1px; border-left-style: solid;">
<div dir=3D"ltr"><div>They will think so by analogy with other similar gene=
ral functions as for example advance that can be used with any type of iter=
ators (except output iterators).</div><div><br>=DE=C5=D4=D7=C5=D2=C7, 24 =
=CF=CB=D4=D1=C2=D2=D1 2013 =C7., 3:57:48 UTC+4 =D0=CF=CC=D8=DA=CF=D7=
=C1=D4=C5=CC=D8 Vlad from Moscow =CE=C1=D0=C9=D3=C1=CC:</div>
<div><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-left-style: solid;"><div dir=3D"ltr"><div>In my personal=
opinion there is two problems. It is not clear what is the return type of =
append. And such record can confuse users because they will think that they=
can use any container because the function iis a general non-member functi=
on.</div>
<div><br>=DE=C5=D4=D7=C5=D2=C7, 24 =CF=CB=D4=D1=C2=D2=D1 2013 =C7., 3:=
51:46 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><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">And yet, is no less clearly expressed as:<div><div style=
=3D"font-family: arial,sans-serif; font-size: 13px;">std::vector<int>=
v2( v1.begin(), range.first );</div><div style=3D"font-family: arial,=
sans-serif; font-size: 13px;">
append( v2, std::next( range.second ), v1.end() );</div></div><di=
v style=3D"font-family: arial,sans-serif; font-size: 13px;"><br></div><div =
style=3D"font-family: arial,sans-serif; font-size: 13px;">which you can alr=
eady do today without needing a standard modification.</div>
</div><div><br clear=3D"all"><div><div dir=3D"ltr"><div>Billy O'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/u=
sers/82320/billy-oneal" target=3D"_blank">http://stackoverflow.com/<u></u>u=
sers<u></u><wbr>/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:32 PM, Vlad fr=
om Moscow <span dir=3D"ltr"><<a>vlad....@mail.ru</a>></span> wrote:<b=
r><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;">
<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>=
</div><div>To demonstrate that append looks much better than insert I=
will show the following assignment.</div>
<div> Let;s assume that there is a vector v1 and you need to copy =
; its elements in another vector v2 excluding some range that specified by =
a pair of iterators. For example one iterator points the fir=
st negative value of the vector and the second iterator points the las=
t negative value of the vector. The simplest way to do the assignment is to=
write</div>
<div> </div><div>std::vector<int> v2( v1.begin(), range.fir=
st );</div><div>v2.append( std::next( range.second ), v1.end() );=
</div><div> </div><div>That is at first the part of the original vecto=
r before the first iterator was copied and then the tail of the origin=
al vector was appended.. The code looks very logically and clearly du=
e to using of append.</div>
<div> </div><div> </div><div> </div><div><br>=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 =CE=C1=D0=C9=D3=C1=CC:</div><blockquo=
te 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><div dir=3D"ltr">Again, append makes sense for basic_string because it=
corresponds to basic_string's operator+=3D. That operation doesn't necessa=
rily make sense for all containers.</div></div><div><div>
<br clear=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/<u></u>users<u></u><u></u><wbr>/82320=
/billy-oneal</a></div>
<div>Malware Response Instructor - BleepingComputer.com</div></div></div>
<br><br></div><div class=3D"gmail_quote"><div>On Wed, Oct 23, 2013 at 4:05 =
PM, Vlad from Moscow <span dir=3D"ltr"><<a>vlad....@mail.ru</a>></spa=
n> wrote:<br></div><blockquote class=3D"gmail_quote" style=3D"margin: 0px 0=
px 0px 0.8ex; padding-left: 1ex; border-left-color: rgb(204, 204, 204); bor=
der-left-width: 1px; border-left-style: solid;">
<div>
<div dir=3D"ltr"><div>In fact there is nothing new with the method append b=
ecause it already exists for std::basic_string. 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 he will quickly understand that method append is necessar=
y.</div>
<div> </div><div>Introducing method append just makes 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 =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" <<a>z...@miator.net</a>> wr=
ote:<br>
> I think we'd better not to regard this as merely a syntax sugar. =
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(). 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></div><span><font color=3D"#888888"><div>
<p></p>
-- <br>
<br>
--- <br>
You received this message because you are subscribed to the Google Groups "=
ISO C++ Standard - Future Proposals" 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><wbr>cpp.org/group/std-<u></u>proposals/</a>.<br>
</div></font></span></blockquote></div><br></div>
</blockquote></div><div><div>
<p></p>
-- <br>
<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>std-proposal...@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><wbr>cpp.org/group/std-<u></u>proposals/</a>.<br>
</div></div></blockquote></div><br></div>
</blockquote></div></blockquote></div></div></div><div><div>
<p></p>
-- <br>
<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>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<wbr=
>cpp.org/group/std-<u></u>proposals/</a>.<br>
</div></div></blockquote></div><br></div></div></div></div>
</blockquote></div><div><div>
<p></p>
-- <br>
<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"=
yDZZdeOJ3UkJ">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"yDZZdeOJ3UkJ">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>
</div></div></blockquote></div><br></div>
</blockquote></div>
<p></p>
-- <br />
<br />
--- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals" 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_2369_29821266.1382602575389--
.
Author: Vlad from Moscow <vlad.moscow@mail.ru>
Date: Thu, 24 Oct 2013 03:38:15 -0700 (PDT)
Raw View
------=_Part_140_6878574.1382611095749
Content-Type: text/plain; charset=KOI8-R
Content-Transfer-Encoding: quoted-printable
=DE=C5=D4=D7=C5=D2=C7, 24 =CF=CB=D4=D1=C2=D2=D1 2013 =C7., 4:10:28 UTC+4 =
=D0=CF=CC=D8=DA=CF=D7=C1=D4=C5=CC=D8 Zhihao Yuan =CE=C1=D0=C9=D3=C1=CC:
>
> On Wed, Oct 23, 2013 at 7:05 PM, Vlad from Moscow <vlad....@mail.ru<javas=
cript:>>=20
> wrote:=20
> > 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=
=20
> to=20
> > try do not use append with std::basic string and substitute it=20
> everywhere in=20
> > code for insert. I am sure that through a month of such coding he will=
=20
> > quickly understand that method append is necessary.=20
> >=20
> > Introducing method append just makes the common interface of sequential=
=20
> > containers more consistent.=20
>
> I would say please forget about basic_string. basic_string=20
> is not a general purpose container, so there is minimal reason=20
> to say "more consistent". Containers and string are different.=20
>
I can not agree with you. To have a common interface for all sequential=20
containers is a good idea. std::basic_string has method push_back and=20
method append so I do not see any reason to forget about basic_string.:)
=20
=20
> For example, string's insert() methods returns string&, do you=20
> want containers' insert() also return container&? Leave different=20
> things different.=20
>
> But method append will return reference to the container itself. And=20
std::basic_string has the same behaviour for append.
=20
> So far I understand append() as "bulk push_back", so I suggested=20
> to have a "bulk push_front" as well, both as simplified interfaces=20
> to insert(). Now I think it would be more clear if we name append()=20
> `extend_back`, and prepend() `extend_front`. Just keep away from=20
> string's append(), which even can take a pointer to char -- don't tell=20
> me you want to take T* as well.=20
>
> =20
As for the prepand then in fact it is insert method because elements of the=
=20
container logically or physically are shifted left. So opposite to append=
=20
there is no the same greate sense to introduce prepand.=20
> --=20
> Zhihao Yuan, ID lichray=20
> The best way to predict the future is to invent it.=20
> ___________________________________________________=20
> 4BSD -- http://4bsd.biz/=20
>
--=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_140_6878574.1382611095749
Content-Type: text/html; charset=KOI8-R
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr"><br>=DE=C5=D4=D7=C5=D2=C7, 24 =CF=CB=D4=D1=C2=D2=D1 2013&n=
bsp;=C7., 4:10:28 UTC+4 =D0=CF=CC=D8=DA=CF=D7=C1=D4=C5=CC=D8 Zhihao Yuan =
=CE=C1=D0=C9=D3=C1=CC:<blockquote class=3D"gmail_quote" style=3D"margin: 0p=
x 0px 0px 0.8ex; padding-left: 1ex; border-left-color: rgb(204, 204, 204); =
border-left-width: 1px; border-left-style: solid;">On Wed, Oct 23, 2013 at =
7:05 PM, Vlad from Moscow <<a href=3D"javascript:" target=3D"_blank" gdf=
-obfuscated-mailto=3D"fLAM44Gz7C4J">vlad....@mail.ru</a>> wrote:
<br>> In fact there is nothing new with the method append because it alr=
eady
<br>> exists for std::basic_string. If somebody has some doubts then I a=
dvise to
<br>> try do not use append with std::basic string and substitute it eve=
rywhere in
<br>> code for insert. I am sure that through a month of such coding he =
will
<br>> quickly understand that method append is necessary.
<br>>
<br>> Introducing method append just makes the common interface of seque=
ntial
<br>> containers more consistent.
<br>
<br>I would say please forget about basic_string. basic_string
<br>is not a general purpose container, so there is minimal reason
<br>to say "more consistent". Containers and string are different.
<br></blockquote><div>I can not agree with you. To have a common interface =
for all sequential containers is a good idea. std::basic_string has method =
push_back and method append so I do not see any reason to forget about basi=
c_string.:)</div><div> </div><div> </div><blockquote class=3D"gma=
il_quote" style=3D"margin: 0px 0px 0px 0.8ex; padding-left: 1ex; border-lef=
t-color: rgb(204, 204, 204); border-left-width: 1px; border-left-style: sol=
id;">For example, string's insert() methods returns string&, do you
<br>want containers' insert() also return container&? Leave diffe=
rent
<br>things different.
<br>
<br></blockquote><div>But method append will return reference to the contai=
ner itself. And std::basic_string has the same behaviour for append.</div><=
div> </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-left-style: solid;">So far I understand append() a=
s "bulk push_back", so I suggested
<br>to have a "bulk push_front" as well, both as simplified interfaces
<br>to insert(). Now I think it would be more clear if we name append=
()
<br>`extend_back`, and prepend() `extend_front`. Just keep away from
<br>string's append(), which even can take a pointer to char -- don't tell
<br>me you want to take T* as well.
<br>
<br></blockquote><div> </div><div>As for the prepand then in fact it i=
s insert method because elements of the container logically or physically a=
re shifted left. So opposite to append there is no the same greate sense to=
introduce prepand. </div><blockquote class=3D"gmail_quote" style=3D"m=
argin: 0px 0px 0px 0.8ex; padding-left: 1ex; border-left-color: rgb(204, 20=
4, 204); border-left-width: 1px; border-left-style: solid;">--=20
<br>Zhihao Yuan, ID lichray
<br>The best way to predict the future is to invent it.
<br>______________________________<wbr>_____________________
<br>4BSD -- <a href=3D"http://4bsd.biz/" target=3D"_blank">http://4bsd.biz/=
</a>
<br></blockquote></div>
<p></p>
-- <br />
<br />
--- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals" 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_140_6878574.1382611095749--
.
Author: Evgeny Panasyuk <evgeny.panasyuk@gmail.com>
Date: Thu, 24 Oct 2013 05:50:42 -0700 (PDT)
Raw View
------=_Part_3099_20542618.1382619042848
Content-Type: text/plain; charset=ISO-8859-1
>
> To make function append a non-member function in my opinion is simply a
> bad idea.
> In fact in this case inside the function you will call method insert
> because there is no other possibility in this design. So it is not
> effective.
>
About which possibility you are talking? Non-member function can be easily
overloaded, providing special version when required.
> Moreover this design only confuses users because you must list those
> containers that can be used with this function.
>
There is no need to list all such containers - there can be many
user-defined containers. std::sort works on random access iterators, and it
does not list all of them.
Only requirenments/concepts can be listed.
> I understand that it can be a new silly question in interview:
> list the containers that can be used with this function and with that
> frunction.
> It is a very poor design.
>
That question is literally equal to "list containers which have this and
that function".
--
---
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/.
------=_Part_3099_20542618.1382619042848
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr"><blockquote class=3D"gmail_quote" style=3D"margin: 0;margi=
n-left: 0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;"><div dir=3D"l=
tr"><div>To make function append a non-member function in my opinion =
is simply a bad idea. </div><div>In fact in this case inside the function y=
ou will call method insert because there is no other possibility in this de=
sign. So it is not effective.</div></div></blockquote><div><br>About which =
possibility you are talking? Non-member function can be easily overloaded, =
providing special version when required.<br> </div><blockquote class=
=3D"gmail_quote" style=3D"margin: 0;margin-left: 0.8ex;border-left: 1px #cc=
c solid;padding-left: 1ex;"><div dir=3D"ltr"><div>Moreover this design only=
confuses users because you must list those containers that can be used wit=
h this function.</div></div></blockquote><div><br>There is no need to list =
all such containers - there can be many user-defined containers. std::sort =
works on random access iterators, and it does not list all of them.<br>Only=
requirenments/concepts can be listed.<br> </div><blockquote class=3D"=
gmail_quote" style=3D"margin: 0;margin-left: 0.8ex;border-left: 1px #ccc so=
lid;padding-left: 1ex;"><div dir=3D"ltr"><div>I understand that it can be a=
new silly question in interview: list the containers that can be=
used with this function and with that frunction.</div><div> It is a v=
ery poor design.</div></div></blockquote><div><br>That question is literall=
y equal to "list containers which have this and that function".<br> </=
div></div>
<p></p>
-- <br />
<br />
--- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals" 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_3099_20542618.1382619042848--
.
Author: "=?utf-8?B?YmlsbHkub25lYWxAZ21haWwuY29t?=" <billy.oneal@gmail.com>
Date: Thu, 24 Oct 2013 05:58:26 -0700
Raw View
------=_Part_0_1382619506585
Content-Type: text/plain; charset=KOI8-R
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline
Obviously, repeating "it will confuse users" is getting you no closer to an=
approved proposal, considering nobody else has stepped up in favor of the =
member function.
Sent from a touchscreen. Please excuse the brevity and tpyos.
----- Reply message -----
From: "Vlad from Moscow" <vlad.moscow@mail.ru>
To: <std-proposals@isocpp.org>
Subject: [std-proposals] Re: To add the method append for all sequential co=
ntainers that have method push_back
Date: Thu, Oct 24, 2013 1:16 AM
To make function append a non-member function in my opinion is simply a ba=
d idea.=20
In fact in this case inside the function you will call method insert becaus=
e there is no other possibility in this design. So it is not effective. Mor=
eover this design only confuses users because you must list those container=
s that can be used with this function. I understand that it can be a new si=
lly question in interview: list the containers that can be used with this f=
unction and with that frunction.
It is a very poor design. And when methods will be chained together it will=
lagain look badly: a mix of member and non-member functions.
I
=DE=C5=D4=D7=C5=D2=C7, 24 =CF=CB=D4=D1=C2=D2=D1 2013 =C7., 4:35:47 UTC+4 =
=D0=CF=CC=D8=DA=CF=D7=C1=D4=C5=CC=D8 Billy O'Neal =CE=C1=D0=C9=D3=C1=CC:
Erm, I didn't bring up algorithms, you did. (Your example was std::advance)=
And there's nothing special about them. All functions have preconditions. =
You can take any old C API and show preconditions. For example:
std::string s;
std::abs(s); // Compiler error
Append is no different.
More to the point, even the member append on basic_string has preconditions=
.. For instance, in the overload of append taking an iterator range, the pre=
conditions are that the parameters are in fact an iterator range. Which com=
es with all sorts of implied conditions which can't be checked at compile t=
ime. (E.g. the iterators must point to the same source range)
Billy O'Neal
https://github.com/BillyONeal/
http://stackoverflow.com/users/82320/billy-oneal
Malware Response Instructor - BleepingComputer.com
On Wed, Oct 23, 2013 at 5:20 PM, Vlad from Moscow <vlad....@mail.ru> wrote:
In my opinion it is a bad analogy with algorithms. Algorithms are special f=
unctions that have preconditions.=20
=DE=C5=D4=D7=C5=D2=C7, 24 =CF=CB=D4=D1=C2=D2=D1 2013 =C7., 4:10:55 UTC+4 =
=D0=CF=CC=D8=DA=CF=D7=C1=D4=C5=CC=D8 Billy O'Neal =CE=C1=D0=C9=D3=C1=CC:
>It is not clear what is the return type of append.
By that standard, the return type of append here isn't clear either:
v2.append( std::next( range.second ), v1.end() );
Member-ness or nonmember-ness doesn't tell the caller *anything* about the =
return type.
>can confuse users because they will think that they can use any container =
because the function iis a general non-member function
By that metric, any STL algorithm that requires bidirectional iterators wou=
ldn't be allowed, because they don't work with input iterators. In fact, ad=
vance would be a great *counter example* to your claim, because it isn't ob=
vious why std::advance(std::istream_iterator( ... ), -2) wouldn't work.
Users are expected to understand the function they are calling before calli=
ng it.
Billy O'Neal
https://github.com/BillyONeal/
http://stackoverflow.com/users/82320/billy-oneal
Malware Response Instructor - BleepingComputer.com
On Wed, Oct 23, 2013 at 4:59 PM, Vlad from Moscow <vlad....@mail.ru> wrote:
They will think so by analogy with other similar general functions as for e=
xample advance that can be used with any type of iterators (except output i=
terators).
=DE=C5=D4=D7=C5=D2=C7, 24 =CF=CB=D4=D1=C2=D2=D1 2013 =C7., 3:57:48 UTC+4 =
=D0=CF=CC=D8=DA=CF=D7=C1=D4=C5=CC=D8 Vlad from Moscow =CE=C1=D0=C9=D3=C1=CC=
:
In my personal opinion there is two problems. It is not clear what is the r=
eturn type of append. And such record can confuse users because they will t=
hink that they can use any container because the function iis a general non=
-member function.
=DE=C5=D4=D7=C5=D2=C7, 24 =CF=CB=D4=D1=C2=D2=D1 2013 =C7., 3:51:46 UTC+4 =
=D0=CF=CC=D8=DA=CF=D7=C1=D4=C5=CC=D8 Billy O'Neal =CE=C1=D0=C9=D3=C1=CC:
And yet, is no less clearly expressed as:std::vector<int> v2( v1.begin(), r=
ange.first );
append( v2, std::next( range.second ), v1.end() );
which you can already do today without needing a standard modification.
Billy O'Neal
https://github.com/BillyONeal/
http://stackoverflow.com/users/82320/billy-oneal
Malware Response Instructor - BleepingComputer.com
On Wed, Oct 23, 2013 at 4:32 PM, Vlad from Moscow <vlad....@mail.ru> wrote:
Billy, I do not think that append flows out of operator +=3D. It looks like=
that operator +=3D flows out of append.:)
To demonstrate that append looks much better than insert I will show the fo=
llowing assignment.
Let;s assume that there is a vector v1 and you need to copy its elements i=
n another vector v2 excluding some range that specified by a pair of iterat=
ors. For example one iterator points the first negative value of the vector=
and the second iterator points the last negative value of the vector. The =
simplest way to do the assignment is to write
std::vector<int> v2( v1.begin(), range.first );
v2.append( std::next( range.second ), v1.end() );
That is at first the part of the original vector before the first iterator =
was copied and then the tail of the original vector was appended.. The cod=
e looks very logically and clearly due to using of append.
=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 =CE=C1=D0=C9=D3=C1=CC:
Again, append makes sense for basic_string because it corresponds to basic_=
string's operator+=3D. That operation doesn't necessarily make sense for al=
l containers.
Billy O'Neal
https://github.com/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> wrote:
In fact there is nothing new with the method append because it already exis=
ts for std::basic_string. If somebody has some doubts then I advise to try =
do not use append with std::basic string and substitute it everywhere in co=
de for insert. I am sure that through a month of such coding he will quickl=
y understand that method append is necessary.
Introducing method append just makes the common interface of sequential con=
tainers 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 =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 looke=
d 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 insert(). =
Not sure how beneficial it is though, but so far it looks not too useless.
PS: If you agree with this rationale, I would suggest to add prepend() meth=
od to deque, list, and forward_list as well.
--=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-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-proposa=
ls/.
--=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-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-proposa=
ls/.
--=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-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-proposa=
ls/.
--=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-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-proposa=
ls/.
--=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/.
--=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_0_1382619506585
Content-Type: text/html; charset=KOI8-R
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline
<div style=3D"font-size: 12pt; font-family: Calibri,sans-serif;"><div>Obvio=
usly, repeating "it will confuse users" is getting you no closer to an appr=
oved proposal, considering nobody else has stepped up in favor of the membe=
r function.</div><div><br></div><div>Sent from a touchscreen. Please excuse=
the brevity and tpyos.</div><br><div id=3D"htc_header">----- Reply message=
-----<br>From: "Vlad from Moscow" <vlad.moscow@mail.ru><br=
>To: <std-proposals@isocpp.org><br>Subject: [std-proposals] Re: To ad=
d the method append for all sequential containers that have method push_bac=
k<br>Date: Thu, Oct 24, 2013 1:16 AM</div></div><br><div dir=3D"ltr"><div>T=
o make function append a non-member function in my opinion is simply =
a bad idea. </div><div>In fact in this case inside the function you will ca=
ll method insert because there is no other possibility in this design. So i=
t is not effective. Moreover this design only confuses users because you mu=
st list those containers that can be used with this function. I understand =
that it can be a new silly question in interview: list the contai=
ners that can be used with this function and with that frunction.</div><div=
> It is a very poor design. And when methods will be chained together =
it will lagain look badly: a mix of member and non-member functions.</div><=
div>I</div><div><br>=DE=C5=D4=D7=C5=D2=C7, 24 =CF=CB=D4=D1=C2=D2=D1 2013&nb=
sp;=C7., 4:35:47 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><blockquote class=3D"gmail_quote" style=3D"marg=
in: 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>Erm, I didn't bring up algorithms, you did. (Your example was std::adva=
nce) And there's nothing special about them. All functions have preconditio=
ns. You can take any old C API and show preconditions. For example:</div>
<div> </div><div>std::string s;</div><div>std::abs(s); // Compiler err=
or</div><div> </div><div>Append is no different.</div><div> </div=
><div>More to the point, even the member append on basic_string has precond=
itions. For instance, in the overload of append taking an iterator range, t=
he preconditions are that the parameters are in fact an iterator range. Whi=
ch comes with all sorts of implied conditions which can't be checked at com=
pile time. (E.g. the iterators must point to the same source range)</div>
</div><div><br clear=3D"all"><div><div dir=3D"ltr"><div>Billy O'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/u=
sers/82320/billy-oneal" target=3D"_blank">http://stackoverflow.com/<wbr>use=
rs/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 5:20 PM, Vlad fr=
om Moscow <span dir=3D"ltr"><<a href=3D"javascript:" target=3D"_blank" g=
df-obfuscated-mailto=3D"yDZZdeOJ3UkJ">vlad....@mail.ru</a>></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 my opinion it is a bad analogy with algorithms. Al=
gorithms are special functions that have preconditions. </div><div><br>=DE=
=C5=D4=D7=C5=D2=C7, 24 =CF=CB=D4=D1=C2=D2=D1 2013 =C7., 4:10:55 UTC+4 =
=D0=CF=CC=D8=DA=CF=D7=C1=D4=C5=CC=D8 Billy O'Neal =CE=C1=D0=C9=D3=C1=CC:</d=
iv>
<blockquote class=3D"gmail_quote" style=3D"margin: 0px 0px 0px 0.8ex; paddi=
ng-left: 1ex; border-left-color: rgb(204, 204, 204); border-left-width: 1px=
; border-left-style: solid;"><div dir=3D"ltr"><div><div>><span style=3D"=
font-family: arial,sans-serif; font-size: 13px;">It is not clear what is th=
e return type of append.<br>
</span>By that standard, the return type of append here isn't clear either:=
</div><div>
<span style=3D"font-family: arial,sans-serif; font-size: 13px;">v2.append( =
std::next( range.second ), v1.end() );</span><br></div><div><span=
style=3D"font-family: arial,sans-serif; font-size: 13px;"><br></span></div=
><div><font face=3D"arial, sans-serif">Member-ness or nonmember-ness doesn'=
t tell the caller *anything* about the return type.</font></div>
<div><font face=3D"arial, sans-serif"><br></font></div><div><font face=3D"a=
rial, sans-serif">></font><span style=3D"font-family: arial,sans-serif; =
font-size: 13px;">can confuse users because they will think that they can u=
se any container because the function iis a general non-member function</sp=
an></div>
<div><span style=3D"font-family: arial,sans-serif; font-size: 13px;"><br></=
span></div><div><span style=3D"font-family: arial,sans-serif; font-size: 13=
px;">By that metric, any STL algorithm that requires bidirectional iterator=
s wouldn't be allowed, because they don't work with input iterators. In fac=
t, advance would be a great *counter example* to your claim, because it isn=
't obvious why std::advance(std::istream_<u></u>iter<wbr>ator( ... ), -2) w=
ouldn't work.</span></div>
<div><span style=3D"font-family: arial,sans-serif; font-size: 13px;"><br></=
span></div><div><span style=3D"font-family: arial,sans-serif; font-size: 13=
px;">Users are expected to understand the function they are calling before =
calling it.</span></div>
</div><div><div><br clear=3D"all"><div><div dir=3D"ltr"><div>Billy O'Neal</=
div><div><a href=3D"https://bitbucket.org/BillyONeal/" target=3D"_blank">ht=
tps://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<wbr>/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 Wed, Oct 23, 2013 at =
4:59 PM, Vlad from Moscow <span dir=3D"ltr"><<a>vlad....@mail.ru</a>>=
</span> wrote:<br><blockquote class=3D"gmail_quote" style=3D"margin: 0px 0p=
x 0px 0.8ex; padding-left: 1ex; border-left-color: rgb(204, 204, 204); bord=
er-left-width: 1px; border-left-style: solid;">
<div dir=3D"ltr"><div>They will think so by analogy with other similar gene=
ral functions as for example advance that can be used with any type of iter=
ators (except output iterators).</div><div><br>=DE=C5=D4=D7=C5=D2=C7, 24 =
=CF=CB=D4=D1=C2=D2=D1 2013 =C7., 3:57:48 UTC+4 =D0=CF=CC=D8=DA=CF=D7=
=C1=D4=C5=CC=D8 Vlad from Moscow =CE=C1=D0=C9=D3=C1=CC:</div>
<div><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-left-style: solid;"><div dir=3D"ltr"><div>In my personal=
opinion there is two problems. It is not clear what is the return type of =
append. And such record can confuse users because they will think that they=
can use any container because the function iis a general non-member functi=
on.</div>
<div><br>=DE=C5=D4=D7=C5=D2=C7, 24 =CF=CB=D4=D1=C2=D2=D1 2013 =C7., 3:=
51:46 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><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">And yet, is no less clearly expressed as:<div><div style=
=3D"font-family: arial,sans-serif; font-size: 13px;">std::vector<int>=
v2( v1.begin(), range.first );</div><div style=3D"font-family: arial,=
sans-serif; font-size: 13px;">
append( v2, std::next( range.second ), v1.end() );</div></div><di=
v style=3D"font-family: arial,sans-serif; font-size: 13px;"><br></div><div =
style=3D"font-family: arial,sans-serif; font-size: 13px;">which you can alr=
eady do today without needing a standard modification.</div>
</div><div><br clear=3D"all"><div><div dir=3D"ltr"><div>Billy O'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/u=
sers/82320/billy-oneal" target=3D"_blank">http://stackoverflow.com/<u></u>u=
sers<u></u><wbr>/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:32 PM, Vlad fr=
om Moscow <span dir=3D"ltr"><<a>vlad....@mail.ru</a>></span> wrote:<b=
r><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;">
<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>=
</div><div>To demonstrate that append looks much better than insert I=
will show the following assignment.</div>
<div> Let;s assume that there is a vector v1 and you need to copy =
; its elements in another vector v2 excluding some range that specified by =
a pair of iterators. For example one iterator points the fir=
st negative value of the vector and the second iterator points the las=
t negative value of the vector. The simplest way to do the assignment is to=
write</div>
<div> </div><div>std::vector<int> v2( v1.begin(), range.fir=
st );</div><div>v2.append( std::next( range.second ), v1.end() );=
</div><div> </div><div>That is at first the part of the original vecto=
r before the first iterator was copied and then the tail of the origin=
al vector was appended.. The code looks very logically and clearly du=
e to using of append.</div>
<div> </div><div> </div><div> </div><div><br>=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 =CE=C1=D0=C9=D3=C1=CC:</div><blockquo=
te 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><div dir=3D"ltr">Again, append makes sense for basic_string because it=
corresponds to basic_string's operator+=3D. That operation doesn't necessa=
rily make sense for all containers.</div></div><div><div>
<br clear=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/<u></u>users<u></u><u></u><wbr>/82320=
/billy-oneal</a></div>
<div>Malware Response Instructor - BleepingComputer.com</div></div></div>
<br><br></div><div class=3D"gmail_quote"><div>On Wed, Oct 23, 2013 at 4:05 =
PM, Vlad from Moscow <span dir=3D"ltr"><<a>vlad....@mail.ru</a>></spa=
n> wrote:<br></div><blockquote class=3D"gmail_quote" style=3D"margin: 0px 0=
px 0px 0.8ex; padding-left: 1ex; border-left-color: rgb(204, 204, 204); bor=
der-left-width: 1px; border-left-style: solid;">
<div>
<div dir=3D"ltr"><div>In fact there is nothing new with the method append b=
ecause it already exists for std::basic_string. 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 he will quickly understand that method append is necessar=
y.</div>
<div> </div><div>Introducing method append just makes 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 =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" <<a>z...@miator.net</a>> wr=
ote:<br>
> I think we'd better not to regard this as merely a syntax sugar. =
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(). 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></div><span><font color=3D"#888888"><div>
<p></p>
-- <br>
<br>
--- <br>
You received this message because you are subscribed to the Google Groups "=
ISO C++ Standard - Future Proposals" 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><wbr>cpp.org/group/std-<u></u>proposals/</a>.<br>
</div></font></span></blockquote></div><br></div>
</blockquote></div><div><div>
<p></p>
-- <br>
<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>std-proposal...@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><wbr>cpp.org/group/std-<u></u>proposals/</a>.<br>
</div></div></blockquote></div><br></div>
</blockquote></div></blockquote></div></div></div><div><div>
<p></p>
-- <br>
<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>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<wbr=
>cpp.org/group/std-<u></u>proposals/</a>.<br>
</div></div></blockquote></div><br></div></div></div></div>
</blockquote></div><div><div>
<p></p>
-- <br>
<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"=
yDZZdeOJ3UkJ">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"yDZZdeOJ3UkJ">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>
</div></div></blockquote></div><br></div>
</blockquote></div>
<p></p>
-- <br />
<br />
--- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals" 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 />
<p></p>
-- <br />
<br />
--- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals" 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_0_1382619506585--
.
Author: Ville Voutilainen <ville.voutilainen@gmail.com>
Date: Thu, 24 Oct 2013 16:08:20 +0300
Raw View
--001a11c28688f540bc04e97c53eb
Content-Type: text/plain; charset=ISO-8859-1
On 24 October 2013 15:58, billy.oneal@gmail.com <billy.oneal@gmail.com>wrote:
> Obviously, repeating "it will confuse users" is getting you no closer to
> an approved proposal, considering nobody else has stepped up in favor of
> the member function.
>
If people misunderstand what I wrote in
https://groups.google.com/a/isocpp.org/d/msg/std-proposals/zsFlISuKYJc/E1cF4uRiumwJ
I should then probably say that I'd prefer a member function to a free
function.
--
---
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/.
--001a11c28688f540bc04e97c53eb
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr"><br><div class=3D"gmail_extra"><br><br><div class=3D"gmail=
_quote">On 24 October 2013 15:58, <a href=3D"mailto:billy.oneal@gmail.com">=
billy.oneal@gmail.com</a> <span dir=3D"ltr"><<a href=3D"mailto:billy.one=
al@gmail.com" target=3D"_blank">billy.oneal@gmail.com</a>></span> wrote:=
<br>
<blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-=
left:1px solid rgb(204,204,204);padding-left:1ex"><div style=3D"font-size:1=
2pt;font-family:Calibri,sans-serif"><div>Obviously, repeating "it will=
confuse users" is getting you no closer to an approved proposal, cons=
idering nobody else has stepped up in favor of the member function.</div>
</div></blockquote><div><br></div><div>If people misunderstand what I wrote=
in<br><a href=3D"https://groups.google.com/a/isocpp.org/d/msg/std-proposal=
s/zsFlISuKYJc/E1cF4uRiumwJ">https://groups.google.com/a/isocpp.org/d/msg/st=
d-proposals/zsFlISuKYJc/E1cF4uRiumwJ</a><br>
</div><div>I should then probably say that I'd prefer a member function=
to a free function.<br></div></div></div></div>
<p></p>
-- <br />
<br />
--- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals" 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 />
--001a11c28688f540bc04e97c53eb--
.
Author: Nevin Liber <nevin@eviloverlord.com>
Date: Thu, 24 Oct 2013 10:40:05 -0400
Raw View
--047d7b624d34798e5f04e97d9ee7
Content-Type: text/plain; charset=ISO-8859-1
On 23 October 2013 18:31, Zhihao Yuan <zy@miator.net> wrote:
> 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
> insert().
>
1. You still need to implement insert anyway.
2. I can't imagine it has much benefit. As far as library optimizations
go, an implementor right now can always do the end() check in insert and
branch to the simpler code if it is indeed better; a decent optimizer
should optimize the branch away when written like v.insert(v.end(), b, e);.
(Note: doing so might be a pessimization for insert in general when it
cannot be determined at compile time whether or not the position == end()),
due to increased code size.)
I look forward to seeing benchmark numbers for this (if anyone cares enough
to generate them, and if they don't, that is telling, too).
--
Nevin ":-)" Liber <mailto:nevin@eviloverlord.com> (847) 691-1404
--
---
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/.
--047d7b624d34798e5f04e97d9ee7
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr"><div class=3D"gmail_extra"><div class=3D"gmail_quote">On 2=
3 October 2013 18:31, Zhihao Yuan <span dir=3D"ltr"><<a href=3D"mailto:z=
y@miator.net" target=3D"_blank">zy@miator.net</a>></span> wrote:<br><blo=
ckquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1px #c=
cc solid;padding-left:1ex">
<p>I looked at libc++ code and I found that since the position is known to =
be end(), <span class=3D"il">append</span>() can be implemented in a much s=
impler way compared with insert().</p></blockquote></div>1. =A0You still ne=
ed to implement insert anyway.</div>
<div class=3D"gmail_extra"><br></div><div class=3D"gmail_extra">2. =A0I can=
't imagine it has much benefit. =A0As far as library optimizations go, =
an implementor right now can always do the end() check in insert and branch=
to the simpler code if it is indeed better; a decent optimizer should opti=
mize the branch away when written like v.insert(v.end(), b, e);. =A0(Note: =
doing so might be a pessimization for insert in general when it cannot be d=
etermined at compile time whether or not the position =3D=3D end()), due to=
increased code size.)</div>
<div class=3D"gmail_extra"><br></div><div class=3D"gmail_extra"><div>I look=
forward to seeing benchmark numbers for this (if anyone cares enough to ge=
nerate them, and if they don't, that is telling, too).</div>-- <br>=A0N=
evin ":-)" Liber=A0 <mailto:<a href=3D"mailto:nevin@eviloverlo=
rd.com" target=3D"_blank">nevin@eviloverlord.com</a>>=A0 (847) 691-1404
</div></div>
<p></p>
-- <br />
<br />
--- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals" 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 />
--047d7b624d34798e5f04e97d9ee7--
.
Author: Zhihao Yuan <zy@miator.net>
Date: Thu, 24 Oct 2013 13:10:16 -0400
Raw View
On Thu, Oct 24, 2013 at 10:40 AM, Nevin Liber <nevin@eviloverlord.com> wrote:
> 1. You still need to implement insert anyway.
But you may not need to instantiate it :)
> 2. I can't imagine it has much benefit. As far as library optimizations
> go, an implementor right now can always do the end() check in insert and
> branch to the simpler code if it is indeed better; a decent optimizer should
> optimize the branch away when written like v.insert(v.end(), b, e);. (Note:
> doing so might be a pessimization for insert in general when it cannot be
> determined at compile time whether or not the position == end()), due to
> increased code size.)
Yes. I observed that insert() is never inlined, so there is no chance to
optimize this case. Branch prediction can save a lot, however.
> I look forward to seeing benchmark numbers for this (if anyone cares enough
> to generate them, and if they don't, that is telling, too).
I wrote a crappy patch to implement some vector `extend_back` in
libc++, and benchmarked the forward iterator version with 10000000
times self append 15 items (int) in the front.
Debug mode:
v.insert(end(v), begin(v), begin(v) + 15); 8.0s
v.extend_back(begin(v), begin(v) + 15); 7.6s
-O3
v.insert(end(v), begin(v), begin(v) + 15); 2.27~2.30s
v.extend_back(begin(v), begin(v) + 15); 2.22~2.26.s
So there is some difference but tiny(?); haven't tried more complex
items.
But the implementation is indeed much simpler than insert().
Patch is at
https://gist.github.com/lichray/302b1489e0731d188c10
--
Zhihao Yuan, ID lichray
The best way to predict the future is to invent it.
___________________________________________________
4BSD -- http://4bsd.biz/
--
---
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/.
.