Topic: [std-proposals] Re: STL <algorithm> file's
Author: "=?gb18030?B?1tPQ+dD5?=" <zgf_lawliet@foxmail.com>
Date: Mon, 16 Mar 2015 17:51:27 +0800
Raw View
This is a multi-part message in MIME format.
------=_NextPart_5506A79F_084E72C8_55E3AEDB
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
yep,butthat only a exmaple=E2=95=AE(=E2=95=AF=E2=96=BD=E2=95=B0)=E2=95=AD--=
---------------- =E5=8E=9F=E5=A7=8B=E9=82=AE=E4=BB=B6 ------------------
=E5=8F=91=E4=BB=B6=E4=BA=BA: "=E9=87=91"<i.and.my.little.friends@gmail.com>
=E5=8F=91=E9=80=81=E6=97=B6=E9=97=B4: 2015=E5=B9=B43=E6=9C=8816=E6=97=A5(=
=E6=98=9F=E6=9C=9F=E4=B8=80) =E4=B8=AD=E5=8D=881:49
=E6=94=B6=E4=BB=B6=E4=BA=BA: "std-proposals"<std-proposals@isocpp.org>;
=E4=B8=BB=E9=A2=98: [std-proposals] Re: STL <algorithm> file's function add=
containerparameter overload version
=E5=9C=A8 2015=E5=B9=B43=E6=9C=8815=E6=97=A5=E6=98=9F=E6=9C=9F=E6=97=A5 UTC=
+8=E4=B8=8B=E5=8D=8811:07:54=EF=BC=8C=E6=A5=9A=E8=BD=A9=E5=86=99=E9=81=93=
=EF=BC=9AIn C++14 standard,<type_trait> file's type metafunction add xxx_t =
version.why <algorithm> not add container parameter overload version?
for exmaple:
vector<int> exmaple=3D{1,2,3,4,5};
ChangeArray(exmaple);
vector<int> expect =3D {5,4,3,2,1};
assert(std::equal(exmaple.begin(), exmaple.end(), expect.begin(), expect.en=
d()));
........................................it's too boring!
I want to write:
assert(std::equal(exmaple, {5, 4, 3, 2, 1}));
of course, I could use some macro to generate those wrap function that in =
<algorithm> file.
but <algorithm> has too many function.
we could compare <type_trait> file and <algorithm> file.
why not add container parameter overload version to standard?
Well, as for this specific example, you can write
assert((exmaple =3D=3D vector<int>{5, 4, 3, 2, 1}));
=20
--=20
=20
---=20
You received this message because you are subscribed to a topic in the Goo=
gle Groups "ISO C++ Standard - Future Proposals" group.
To unsubscribe from this topic, visit https://groups.google.com/a/isocpp.o=
rg/d/topic/std-proposals/WJquC7lncwk/unsubscribe.
To unsubscribe from this group and all its topics, send an email to std-pr=
oposals+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-propos=
als/.
--=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/.
------=_NextPart_5506A79F_084E72C8_55E3AEDB
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
yep,butthat only a exmaple=E2=95=AE(=E2=95=AF=E2=96=BD=E2=95=B0)=E2=95=AD<D=
IV style=3D"COLOR: #000"><DIV style=3D"PADDING-RIGHT: 0px; PADDING-LEFT: 0p=
x; FONT-SIZE: 12px; PADDING-BOTTOM: 2px; PADDING-TOP: 2px; FONT-FAMILY: Ari=
al Narrow">------------------ =E5=8E=9F=E5=A7=8B=E9=82=AE=E4=BB=B6&nbs=
p;------------------</DIV><DIV style=3D"PADDING-RIGHT: 8px; PADDING-LEFT: 8=
px; FONT-SIZE: 12px; BACKGROUND: #efefef; PADDING-BOTTOM: 8px; PADDING-TOP:=
8px"><DIV><B>=E5=8F=91=E4=BB=B6=E4=BA=BA:</B> "=E9=87=91"&l=
t;i.and.my.little.friends@gmail.com><wbr/></DIV><DIV><B>=E5=8F=91=E9=80=
=81=E6=97=B6=E9=97=B4:</B> 2015=E5=B9=B43=E6=9C=8816=E6=97=A5(=E6=98=
=9F=E6=9C=9F=E4=B8=80) =E4=B8=AD=E5=8D=881:49</DIV><DIV><B>=E6=94=B6=E4=BB=
=B6=E4=BA=BA:</B> "std-proposals"<std-proposals@isocpp.or=
g>;</DIV><DIV><B>=E4=B8=BB=E9=A2=98:</B> [std-proposals] Re: STL &l=
t;algorithm> file's function add containerparameter overload version</DI=
V></DIV></DIV><div dir=3D"ltr">=E5=9C=A8 2015=E5=B9=B43=E6=9C=8815=E6=97=A5=
=E6=98=9F=E6=9C=9F=E6=97=A5 UTC+8=E4=B8=8B=E5=8D=8811:07:54=EF=BC=8C=E6=A5=
=9A=E8=BD=A9=E5=86=99=E9=81=93=EF=BC=9A<blockquote class=3D"gmail_quote" st=
yle=3D"margin: 0;margin-left: 0.8ex;border-left: 1px #ccc solid;padding-lef=
t: 1ex;"><div dir=3D"ltr">In C++14 standard,<type_trait> file's type =
metafunction add xxx_t version.<div>why <algorithm> not add container=
parameter overload version?</div><div><br /></div><div>for exmaple:</div>=
<div>vector<int> exmaple=3D{1,2,3,4,5};</div><div>ChangeArray(exmaple=
);</div><div>vector<int> expect =3D {5,4,3,2,1};</div><div><br /></d=
iv><div>assert(std::equal(exmaple.<wbr />begin(), exmaple.end(), expect.be=
gin(), expect.end()));</div><div><br /></div><div>........................=
.......<wbr />.........it's too boring!</div><div><br /></div><div>I want =
to write:</div><div><br /></div><div> assert(std::equal(exmaple, {5, =
4, 3, 2, 1}));</div><div><br /></div><div>of course, I could use som=
e macro to generate those wrap function that in <algorithm> file.</di=
v><div>but <algorithm> has too many function.</div><div>we coul=
d compare <type_trait> file and <algorithm> file.</div><div>why=
not add container parameter overload version to standard?</div><div><br /=
></div></div></blockquote><div><br />Well, as for this specific example, y=
ou can write<br /><div class=3D"prettyprint" style=3D"background-color: rg=
b(250, 250, 250); border-color: rgb(187, 187, 187); border-style: solid; bo=
rder-width: 1px; word-wrap: break-word;"><code class=3D"prettyprint"><div c=
lass=3D"subprettyprint"><span style=3D"color: #008;" class=3D"styled-by-pre=
ttify">assert</span><span style=3D"color: #660;" class=3D"styled-by-prettif=
y">((</span><span style=3D"color: #000;" class=3D"styled-by-prettify">exmap=
le </span><span style=3D"color: #660;" class=3D"styled-by-prettify">=3D=3D<=
/span><span style=3D"color: #000;" class=3D"styled-by-prettify"> vector</sp=
an><span style=3D"color: #080;" class=3D"styled-by-prettify"><int></s=
pan><span style=3D"color: #660;" class=3D"styled-by-prettify">{</span><span=
style=3D"color: #066;" class=3D"styled-by-prettify">5</span><span style=3D=
"color: #660;" class=3D"styled-by-prettify">,</span><span style=3D"color: #=
000;" class=3D"styled-by-prettify"> </span><span style=3D"color: #066;" cla=
ss=3D"styled-by-prettify">4</span><span style=3D"color: #660;" class=3D"sty=
led-by-prettify">,</span><span style=3D"color: #000;" class=3D"styled-by-pr=
ettify"> </span><span style=3D"color: #066;" class=3D"styled-by-prettify">3=
</span><span style=3D"color: #660;" class=3D"styled-by-prettify">,</span><s=
pan style=3D"color: #000;" class=3D"styled-by-prettify"> </span><span style=
=3D"color: #066;" class=3D"styled-by-prettify">2</span><span style=3D"color=
: #660;" class=3D"styled-by-prettify">,</span><span style=3D"color: #000;" =
class=3D"styled-by-prettify"> </span><span style=3D"color: #066;" class=3D"=
styled-by-prettify">1</span><span style=3D"color: #660;" class=3D"styled-by=
-prettify">}));</span><span style=3D"color: #000;" class=3D"styled-by-prett=
ify"><br /></span></div></code></div><br /></div></div>
<p></p>
-- <br />
<br />
--- <br />
You received this message because you are subscribed to a topic in the Goog=
le Groups "ISO C++ Standard - Future Proposals" group.<br />
To unsubscribe from this topic, visit <a href=3D"https://groups.google.com/=
a/isocpp.org/d/topic/std-proposals/WJquC7lncwk/unsubscribe">https://groups.=
google.com/a/isocpp.org/d/topic/std-proposals/WJquC7lncwk/unsubscribe</a>.<=
br />
To unsubscribe from this group and all its topics, send an email to <a href=
=3D"mailto:std-proposals+unsubscribe@isocpp.org">std-proposals+unsubscribe@=
isocpp.org</a>.<br />
To post to this group, send email to <a href=3D"mailto:std-proposals@isocpp=
..org">std-proposals@isocpp.org</a>.<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 <a href=3D"mailto:std-proposals+unsubscribe@isocpp.org">std-proposa=
ls+unsubscribe@isocpp.org</a>.<br />
To post to this group, send email to <a href=3D"mailto:std-proposals@isocpp=
..org">std-proposals@isocpp.org</a>.<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 />
------=_NextPart_5506A79F_084E72C8_55E3AEDB--
.