Topic: STL <algorithm> file's function add container
Author: =?UTF-8?B?5qWa6L2p?= <this.l.lawliet@gmail.com>
Date: Sun, 15 Mar 2015 08:07:53 -0700 (PDT)
Raw View
------=_Part_3336_531613635.1426432073566
Content-Type: multipart/alternative;
boundary="----=_Part_3337_1298391925.1426432073566"
------=_Part_3337_1298391925.1426432073566
Content-Type: text/plain; charset=UTF-8
In 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={1,2,3,4,5};
ChangeArray(exmaple);
vector<int> expect = {5,4,3,2,1};
assert(std::equal(exmaple.begin(), exmaple.end(), expect.begin(),
expect.end()));
........................................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?
--
---
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_3337_1298391925.1426432073566
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr">In C++14 standard,<type_trait> file's type metafunct=
ion add xxx_t version.<div>why <algorithm> not add container paramete=
r overload version?</div><div><br></div><div>for exmaple:</div><div>vector&=
lt;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></div><div>assert(=
std::equal(exmaple.begin(), exmaple.end(), expect.begin(), expect.end()));<=
/div><div><br></div><div>.......................................it's too bo=
ring!</div><div><br></div><div>I want to write:</div><div><br></div><div>&n=
bsp;assert(std::equal(exmaple, {5, 4, 3, 2, 1}));</div><div><br></div><div>=
of course, I could use some macro to generate those wrap function tha=
t in <algorithm> file.</div><div>but <algorithm> has too many &=
nbsp;function.</div><div>we could compare <type_trait> file and <a=
lgorithm> file.</div><div>why not add container parameter overload =
version to standard?</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 <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 />
------=_Part_3337_1298391925.1426432073566--
------=_Part_3336_531613635.1426432073566--
.
Author: Nicol Bolas <jmckesson@gmail.com>
Date: Sun, 15 Mar 2015 10:47:45 -0700 (PDT)
Raw View
------=_Part_2619_1753875575.1426441665643
Content-Type: multipart/alternative;
boundary="----=_Part_2620_1026250303.1426441665643"
------=_Part_2620_1026250303.1426441665643
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
On Sunday, March 15, 2015 at 11:07:54 AM UTC-4, =E6=A5=9A=E8=BD=A9 wrote:
>
> In C++14 standard,<type_trait> file's type metafunction add xxx_t version=
..
> why <algorithm> not add container parameter overload version?
>
Because these would be covered by the various Range proposals, of which thi=
s=20
is the latest one <https://ericniebler.github.io/std/wg21/D4128.html> (I=20
think).
--=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_2620_1026250303.1426441665643
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr"><br><br>On Sunday, March 15, 2015 at 11:07:54 AM UTC-4, =
=E6=A5=9A=E8=BD=A9 wrote:<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">In C++14 standard,<type_trait> file's type metafunction a=
dd xxx_t version.<div>why <algorithm> not add container parameter ove=
rload version?</div></div></blockquote><div><br>Because these would be cove=
red by the various Range proposals, of which <a href=3D"https://ericniebler=
..github.io/std/wg21/D4128.html">this is the latest one</a> (I think).</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 <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 />
------=_Part_2620_1026250303.1426441665643--
------=_Part_2619_1753875575.1426441665643--
.
Author: =?UTF-8?B?6YeR?= <i.and.my.little.friends@gmail.com>
Date: Sun, 15 Mar 2015 22:49:43 -0700 (PDT)
Raw View
------=_Part_3906_1075520099.1426484983679
Content-Type: multipart/alternative;
boundary="----=_Part_3907_896447094.1426484983680"
------=_Part_3907_896447094.1426484983680
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
=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
>
> In 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(),=20
> expect.end()));
>
> .......................................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 i=
n=20
> <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
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_3907_896447094.1426484983680
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
<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" style=3D"margi=
n: 0;margin-left: 0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;"><di=
v dir=3D"ltr">In C++14 standard,<type_trait> file's type metafunction=
add xxx_t version.<div>why <algorithm> not add container parameter o=
verload 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>ve=
ctor<int> expect =3D {5,4,3,2,1};</div><div><br></div><div>assert(std=
::equal(exmaple.<wbr>begin(), exmaple.end(), expect.begin(), 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></di=
v><div>of course, I could use some macro to generate those wrap funct=
ion that in <algorithm> file.</div><div>but <algorithm> has too=
many function.</div><div>we could compare <type_trait> file an=
d <algorithm> file.</div><div>why not add container parameter ov=
erload version to standard?</div><div><br></div></div></blockquote><div><br=
>Well, as for this specific example, you can write<br><div class=3D"prettyp=
rint" style=3D"background-color: rgb(250, 250, 250); border-color: rgb(187,=
187, 187); border-style: solid; border-width: 1px; word-wrap: break-word;"=
><code class=3D"prettyprint"><div class=3D"subprettyprint"><span style=3D"c=
olor: #008;" class=3D"styled-by-prettify">assert</span><span style=3D"color=
: #660;" class=3D"styled-by-prettify">((</span><span style=3D"color: #000;"=
class=3D"styled-by-prettify">exmaple </span><span style=3D"color: #660;" c=
lass=3D"styled-by-prettify">=3D=3D</span><span style=3D"color: #000;" class=
=3D"styled-by-prettify"> vector</span><span style=3D"color: #080;" class=3D=
"styled-by-prettify"><int></span><span style=3D"color: #660;" class=
=3D"styled-by-prettify">{</span><span style=3D"color: #066;" class=3D"style=
d-by-prettify">5</span><span style=3D"color: #660;" class=3D"styled-by-pret=
tify">,</span><span style=3D"color: #000;" class=3D"styled-by-prettify"> </=
span><span style=3D"color: #066;" class=3D"styled-by-prettify">4</span><spa=
n 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">3</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">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 st=
yle=3D"color: #660;" class=3D"styled-by-prettify">}));</span><span style=3D=
"color: #000;" class=3D"styled-by-prettify"><br></span></div></code></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 <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 />
------=_Part_3907_896447094.1426484983680--
------=_Part_3906_1075520099.1426484983679--
.