Topic: min, max, minmax for std::pair
Author: "'Vlad from Moscow' via ISO C++ Standard - Future Proposals" <std-proposals@isocpp.org>
Date: Sat, 9 Dec 2017 06:29:34 -0800 (PST)
Raw View
------=_Part_1048_1383159438.1512829774504
Content-Type: multipart/alternative;
boundary="----=_Part_1049_146419653.1512829774504"
------=_Part_1049_146419653.1512829774504
Content-Type: text/plain; charset="UTF-8"
What about introducing algorithms min, max, and minmax for the template
class std::pair?
r. For example
template <typename T>
constexpr const T & min(const std::pair<T, T> &p)
{
return p.second < p.first ? p.second : p.first;
}
--
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.
To view this discussion on the web visit https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/132ff725-5463-4d9c-a291-3314a56dca50%40isocpp.org.
------=_Part_1049_146419653.1512829774504
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr"><div>What about introducing algorithms min, max, and minma=
x for the template class std::pair?</div><div><br></div><div>r. For example=
</div><div><br></div><div>=C2=A0template <typename T><br>=C2=A0conste=
xpr const T & min(const std::pair<T, T> &p)<br>=C2=A0{<br>=C2=
=A0=C2=A0return p.second < p.first ? p.second : p.first;<br>=C2=A0}<br><=
/div></div>
<p></p>
-- <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 />
To view this discussion on the web visit <a href=3D"https://groups.google.c=
om/a/isocpp.org/d/msgid/std-proposals/132ff725-5463-4d9c-a291-3314a56dca50%=
40isocpp.org?utm_medium=3Demail&utm_source=3Dfooter">https://groups.google.=
com/a/isocpp.org/d/msgid/std-proposals/132ff725-5463-4d9c-a291-3314a56dca50=
%40isocpp.org</a>.<br />
------=_Part_1049_146419653.1512829774504--
------=_Part_1048_1383159438.1512829774504--
.
Author: =?UTF-8?Q?Micha=C5=82_Dominiak?= <griwes@griwes.info>
Date: Sat, 09 Dec 2017 15:25:16 +0000
Raw View
--001a11c00044298fe5055fe9e999
Content-Type: text/plain; charset="UTF-8"
Why?
On Sat, Dec 9, 2017, 3:29 PM 'Vlad from Moscow' via ISO C++ Standard -
Future Proposals <std-proposals@isocpp.org> wrote:
> What about introducing algorithms min, max, and minmax for the template
> class std::pair?
>
> r. For example
>
> template <typename T>
> constexpr const T & min(const std::pair<T, T> &p)
> {
> return p.second < p.first ? p.second : p.first;
> }
>
> --
> 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.
> To view this discussion on the web visit
> https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/132ff725-5463-4d9c-a291-3314a56dca50%40isocpp.org
> <https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/132ff725-5463-4d9c-a291-3314a56dca50%40isocpp.org?utm_medium=email&utm_source=footer>
> .
>
--
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.
To view this discussion on the web visit https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/CAPCFJdR0B8Gt6pCOtRLjFnavCPYh8aOxq6J84gHX1EMCs2_nGQ%40mail.gmail.com.
--001a11c00044298fe5055fe9e999
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
<p dir=3D"ltr">Why? </p>
<br><div class=3D"gmail_quote"><div dir=3D"ltr">On Sat, Dec 9, 2017, 3:29 P=
M 'Vlad from Moscow' via ISO C++ Standard - Future Proposals <<a=
href=3D"mailto:std-proposals@isocpp.org">std-proposals@isocpp.org</a>> =
wrote:<br></div><blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8e=
x;border-left:1px #ccc solid;padding-left:1ex"><div dir=3D"ltr"><div>What a=
bout introducing algorithms min, max, and minmax for the template class std=
::pair?</div><div><br></div><div>r. For example</div><div><br></div><div>=
=C2=A0template <typename T><br>=C2=A0constexpr const T & min(cons=
t std::pair<T, T> &p)<br>=C2=A0{<br>=C2=A0=C2=A0return p.second &=
lt; p.first ? p.second : p.first;<br>=C2=A0}<br></div></div>
<p></p>
-- <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" 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>
To view this discussion on the web visit <a href=3D"https://groups.google.c=
om/a/isocpp.org/d/msgid/std-proposals/132ff725-5463-4d9c-a291-3314a56dca50%=
40isocpp.org?utm_medium=3Demail&utm_source=3Dfooter" target=3D"_blank">=
https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/132ff725-5463-=
4d9c-a291-3314a56dca50%40isocpp.org</a>.<br>
</blockquote></div>
<p></p>
-- <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 />
To view this discussion on the web visit <a href=3D"https://groups.google.c=
om/a/isocpp.org/d/msgid/std-proposals/CAPCFJdR0B8Gt6pCOtRLjFnavCPYh8aOxq6J8=
4gHX1EMCs2_nGQ%40mail.gmail.com?utm_medium=3Demail&utm_source=3Dfooter">htt=
ps://groups.google.com/a/isocpp.org/d/msgid/std-proposals/CAPCFJdR0B8Gt6pCO=
tRLjFnavCPYh8aOxq6J84gHX1EMCs2_nGQ%40mail.gmail.com</a>.<br />
--001a11c00044298fe5055fe9e999--
.
Author: "'Vlad from Moscow' via ISO C++ Standard - Future Proposals" <std-proposals@isocpp.org>
Date: Mon, 11 Dec 2017 06:08:59 -0800 (PST)
Raw View
------=_Part_7856_51092176.1513001339979
Content-Type: multipart/alternative;
boundary="----=_Part_7857_1947243140.1513001339980"
------=_Part_7857_1947243140.1513001339980
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
Why not?
=D1=81=D1=83=D0=B1=D0=B1=D0=BE=D1=82=D0=B0, 9 =D0=B4=D0=B5=D0=BA=D0=B0=D0=
=B1=D1=80=D1=8F 2017 =D0=B3., 18:25:30 UTC+3 =D0=BF=D0=BE=D0=BB=D1=8C=D0=B7=
=D0=BE=D0=B2=D0=B0=D1=82=D0=B5=D0=BB=D1=8C Micha=C5=82 Dominiak=20
=D0=BD=D0=B0=D0=BF=D0=B8=D1=81=D0=B0=D0=BB:
>
> Why?=20
>
> On Sat, Dec 9, 2017, 3:29 PM 'Vlad from Moscow' via ISO C++ Standard -=20
> Future Proposals <std-pr...@isocpp.org <javascript:>> wrote:
>
>> What about introducing algorithms min, max, and minmax for the template=
=20
>> class std::pair?
>>
>> r. For example
>>
>> template <typename T>
>> constexpr const T & min(const std::pair<T, T> &p)
>> {
>> return p.second < p.first ? p.second : p.first;
>> }
>>
>> --=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:>.
>> To view this discussion on the web visit=20
>> https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/132ff725-54=
63-4d9c-a291-3314a56dca50%40isocpp.org=20
>> <https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/132ff725-5=
463-4d9c-a291-3314a56dca50%40isocpp.org?utm_medium=3Demail&utm_source=3Dfoo=
ter>
>> .
>>
>
--=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.
To view this discussion on the web visit https://groups.google.com/a/isocpp=
..org/d/msgid/std-proposals/19271ac8-cb01-4290-8126-ca57a87ef4d9%40isocpp.or=
g.
------=_Part_7857_1947243140.1513001339980
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr">Why not?<br><br>=D1=81=D1=83=D0=B1=D0=B1=D0=BE=D1=82=D0=B0=
, 9 =D0=B4=D0=B5=D0=BA=D0=B0=D0=B1=D1=80=D1=8F 2017 =D0=B3., 18:25:30 UTC+3=
=D0=BF=D0=BE=D0=BB=D1=8C=D0=B7=D0=BE=D0=B2=D0=B0=D1=82=D0=B5=D0=BB=D1=8C M=
icha=C5=82 Dominiak =D0=BD=D0=B0=D0=BF=D0=B8=D1=81=D0=B0=D0=BB:<blockquote =
class=3D"gmail_quote" style=3D"margin: 0;margin-left: 0.8ex;border-left: 1p=
x #ccc solid;padding-left: 1ex;"><p dir=3D"ltr">Why? </p>
<br><div class=3D"gmail_quote"><div dir=3D"ltr">On Sat, Dec 9, 2017, 3:29 P=
M 'Vlad from Moscow' via ISO C++ Standard - Future Proposals <<a=
onmousedown=3D"this.href=3D'javascript:';return true;" onclick=3D"=
this.href=3D'javascript:';return true;" href=3D"javascript:" target=
=3D"_blank" rel=3D"nofollow" gdf-obfuscated-mailto=3D"dhGvcQQ8BQAJ">std-pr.=
...@isocpp.org</a>> wrote:<br></div><blockquote class=3D"gmail_quote" sty=
le=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div d=
ir=3D"ltr"><div>What about introducing algorithms min, max, and minmax for =
the template class std::pair?</div><div><br></div><div>r. For example</div>=
<div><br></div><div>=C2=A0template <typename T><br>=C2=A0constexpr co=
nst T & min(const std::pair<T, T> &p)<br>=C2=A0{<br>=C2=A0=C2=
=A0return p.second < p.first ? p.second : p.first;<br>=C2=A0}<br></div><=
/div>
<p></p>
-- <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 onmousedown=3D"this.href=3D'javascript:';return true;" o=
nclick=3D"this.href=3D'javascript:';return true;" href=3D"javascrip=
t:" target=3D"_blank" rel=3D"nofollow" gdf-obfuscated-mailto=3D"dhGvcQQ8BQA=
J">std-proposal...@<wbr>isocpp.org</a>.<br>
To post to this group, send email to <a onmousedown=3D"this.href=3D'jav=
ascript:';return true;" onclick=3D"this.href=3D'javascript:';re=
turn true;" href=3D"javascript:" target=3D"_blank" rel=3D"nofollow" gdf-obf=
uscated-mailto=3D"dhGvcQQ8BQAJ">std-pr...@isocpp.org</a>.<br>
To view this discussion on the web visit <a onmousedown=3D"this.href=3D'=
;https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/132ff725-5463=
-4d9c-a291-3314a56dca50%40isocpp.org?utm_medium\x3demail\x26utm_source\x3df=
ooter';return true;" onclick=3D"this.href=3D'https://groups.google.=
com/a/isocpp.org/d/msgid/std-proposals/132ff725-5463-4d9c-a291-3314a56dca50=
%40isocpp.org?utm_medium\x3demail\x26utm_source\x3dfooter';return true;=
" href=3D"https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/132f=
f725-5463-4d9c-a291-3314a56dca50%40isocpp.org?utm_medium=3Demail&utm_so=
urce=3Dfooter" target=3D"_blank" rel=3D"nofollow">https://groups.google.com=
/a/<wbr>isocpp.org/d/msgid/std-<wbr>proposals/132ff725-5463-4d9c-<wbr>a291-=
3314a56dca50%40isocpp.org</a><wbr>.<br>
</blockquote></div>
</blockquote></div>
<p></p>
-- <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 />
To view this discussion on the web visit <a href=3D"https://groups.google.c=
om/a/isocpp.org/d/msgid/std-proposals/19271ac8-cb01-4290-8126-ca57a87ef4d9%=
40isocpp.org?utm_medium=3Demail&utm_source=3Dfooter">https://groups.google.=
com/a/isocpp.org/d/msgid/std-proposals/19271ac8-cb01-4290-8126-ca57a87ef4d9=
%40isocpp.org</a>.<br />
------=_Part_7857_1947243140.1513001339980--
------=_Part_7856_51092176.1513001339979--
.
Author: =?UTF-8?Q?Micha=C5=82_Dominiak?= <griwes@griwes.info>
Date: Mon, 11 Dec 2017 14:19:09 +0000
Raw View
--f403043edf8864ade005601138be
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
That's not how it works. You are supposed to present rationale, otherwise
no-one will care about your paper, because without solving an actual
problem, it'll be just a huge waste of time.
On Mon, Dec 11, 2017 at 3:09 PM 'Vlad from Moscow' via ISO C++ Standard -
Future Proposals <std-proposals@isocpp.org> wrote:
> Why not?
>
> =D1=81=D1=83=D0=B1=D0=B1=D0=BE=D1=82=D0=B0, 9 =D0=B4=D0=B5=D0=BA=D0=B0=D0=
=B1=D1=80=D1=8F 2017 =D0=B3., 18:25:30 UTC+3 =D0=BF=D0=BE=D0=BB=D1=8C=D0=B7=
=D0=BE=D0=B2=D0=B0=D1=82=D0=B5=D0=BB=D1=8C Micha=C5=82 Dominiak
> =D0=BD=D0=B0=D0=BF=D0=B8=D1=81=D0=B0=D0=BB:
>>
>> Why?
>>
>> On Sat, Dec 9, 2017, 3:29 PM 'Vlad from Moscow' via ISO C++ Standard -
>> Future Proposals <std-pr...@isocpp.org> wrote:
>>
> What about introducing algorithms min, max, and minmax for the template
>>> class std::pair?
>>>
>>> r. For example
>>>
>>> template <typename T>
>>> constexpr const T & min(const std::pair<T, T> &p)
>>> {
>>> return p.second < p.first ? p.second : p.first;
>>> }
>>>
>>> --
>>> 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 a=
n
>>> email to std-proposal...@isocpp.org.
>>> To post to this group, send email to std-pr...@isocpp.org.
>>
>>
>>> To view this discussion on the web visit
>>> https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/132ff725-5=
463-4d9c-a291-3314a56dca50%40isocpp.org
>>> <https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/132ff725-=
5463-4d9c-a291-3314a56dca50%40isocpp.org?utm_medium=3Demail&utm_source=3Dfo=
oter>
>>> .
>>>
>> --
> 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.
> To view this discussion on the web visit
> https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/19271ac8-cb0=
1-4290-8126-ca57a87ef4d9%40isocpp.org
> <https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/19271ac8-cb=
01-4290-8126-ca57a87ef4d9%40isocpp.org?utm_medium=3Demail&utm_source=3Dfoot=
er>
> .
>
--=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.
To view this discussion on the web visit https://groups.google.com/a/isocpp=
..org/d/msgid/std-proposals/CAPCFJdQG50S0RR-g12%2B-S%2BN5mY5zucgQu%2BvfEDREN=
ob0Ea0ERA%40mail.gmail.com.
--f403043edf8864ade005601138be
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr">That's not how it works. You are supposed to present r=
ationale, otherwise no-one will care about your paper, because without solv=
ing an actual problem, it'll be just a huge waste of time.</div><br><di=
v class=3D"gmail_quote"><div dir=3D"ltr">On Mon, Dec 11, 2017 at 3:09 PM &#=
39;Vlad from Moscow' via ISO C++ Standard - Future Proposals <<a hre=
f=3D"mailto:std-proposals@isocpp.org">std-proposals@isocpp.org</a>> wrot=
e:<br></div><blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;bo=
rder-left:1px #ccc solid;padding-left:1ex"><div dir=3D"ltr">Why not?<br><br=
>=D1=81=D1=83=D0=B1=D0=B1=D0=BE=D1=82=D0=B0, 9 =D0=B4=D0=B5=D0=BA=D0=B0=D0=
=B1=D1=80=D1=8F 2017 =D0=B3., 18:25:30 UTC+3 =D0=BF=D0=BE=D0=BB=D1=8C=D0=B7=
=D0=BE=D0=B2=D0=B0=D1=82=D0=B5=D0=BB=D1=8C Micha=C5=82 Dominiak =D0=BD=D0=
=B0=D0=BF=D0=B8=D1=81=D0=B0=D0=BB:<blockquote class=3D"gmail_quote" style=
=3D"margin:0;margin-left:0.8ex;border-left:1px #ccc solid;padding-left:1ex"=
><p dir=3D"ltr">Why? </p>
<br><div class=3D"gmail_quote"></div></blockquote></div><div dir=3D"ltr"><b=
lockquote class=3D"gmail_quote" style=3D"margin:0;margin-left:0.8ex;border-=
left:1px #ccc solid;padding-left:1ex"><div class=3D"gmail_quote"><div dir=
=3D"ltr">On Sat, Dec 9, 2017, 3:29 PM 'Vlad from Moscow' via ISO C+=
+ Standard - Future Proposals <<a rel=3D"nofollow">std-pr...@isocpp.org<=
/a>> wrote:<br></div></div></blockquote></div><div dir=3D"ltr"><blockquo=
te class=3D"gmail_quote" style=3D"margin:0;margin-left:0.8ex;border-left:1p=
x #ccc solid;padding-left:1ex"><div class=3D"gmail_quote"><blockquote class=
=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padd=
ing-left:1ex"><div dir=3D"ltr"><div>What about introducing algorithms min, =
max, and minmax for the template class std::pair?</div><div><br></div><div>=
r. For example</div><div><br></div><div>=C2=A0template <typename T><b=
r>=C2=A0constexpr const T & min(const std::pair<T, T> &p)<br>=
=C2=A0{<br>=C2=A0=C2=A0return p.second < p.first ? p.second : p.first;<b=
r>=C2=A0}<br></div></div>
<p></p>
-- <br>
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals" group.<br></blockquote></div=
></blockquote></div><div dir=3D"ltr"><blockquote class=3D"gmail_quote" styl=
e=3D"margin:0;margin-left:0.8ex;border-left:1px #ccc solid;padding-left:1ex=
"><div class=3D"gmail_quote"><blockquote class=3D"gmail_quote" style=3D"mar=
gin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to <a rel=3D"nofollow">std-proposal...@isocpp.org</a>.<br>
To post to this group, send email to <a rel=3D"nofollow">std-pr...@isocpp.o=
rg</a>.</blockquote></div></blockquote></div><div dir=3D"ltr"><blockquote c=
lass=3D"gmail_quote" style=3D"margin:0;margin-left:0.8ex;border-left:1px #c=
cc solid;padding-left:1ex"><div class=3D"gmail_quote"><blockquote class=3D"=
gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-=
left:1ex"><br>
To view this discussion on the web visit <a href=3D"https://groups.google.c=
om/a/isocpp.org/d/msgid/std-proposals/132ff725-5463-4d9c-a291-3314a56dca50%=
40isocpp.org?utm_medium=3Demail&utm_source=3Dfooter" rel=3D"nofollow" t=
arget=3D"_blank">https://groups.google.com/a/isocpp.org/d/msgid/std-proposa=
ls/132ff725-5463-4d9c-a291-3314a56dca50%40isocpp.org</a>.<br>
</blockquote></div></blockquote></div>
<p></p>
-- <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" 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>
To view this discussion on the web visit <a href=3D"https://groups.google.c=
om/a/isocpp.org/d/msgid/std-proposals/19271ac8-cb01-4290-8126-ca57a87ef4d9%=
40isocpp.org?utm_medium=3Demail&utm_source=3Dfooter" target=3D"_blank">=
https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/19271ac8-cb01-=
4290-8126-ca57a87ef4d9%40isocpp.org</a>.<br>
</blockquote></div>
<p></p>
-- <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 />
To view this discussion on the web visit <a href=3D"https://groups.google.c=
om/a/isocpp.org/d/msgid/std-proposals/CAPCFJdQG50S0RR-g12%2B-S%2BN5mY5zucgQ=
u%2BvfEDRENob0Ea0ERA%40mail.gmail.com?utm_medium=3Demail&utm_source=3Dfoote=
r">https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/CAPCFJdQG50=
S0RR-g12%2B-S%2BN5mY5zucgQu%2BvfEDRENob0Ea0ERA%40mail.gmail.com</a>.<br />
--f403043edf8864ade005601138be--
.
Author: "'Vlad from Moscow' via ISO C++ Standard - Future Proposals" <std-proposals@isocpp.org>
Date: Mon, 11 Dec 2017 06:31:55 -0800 (PST)
Raw View
------=_Part_7970_407575376.1513002715278
Content-Type: multipart/alternative;
boundary="----=_Part_7971_2052815054.1513002715278"
------=_Part_7971_2052815054.1513002715278
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
I am not discussing "how it works". I want to collect opinions about=20
introducing these functions.
=D0=BF=D0=BE=D0=BD=D0=B5=D0=B4=D0=B5=D0=BB=D1=8C=D0=BD=D0=B8=D0=BA, 11 =D0=
=B4=D0=B5=D0=BA=D0=B0=D0=B1=D1=80=D1=8F 2017 =D0=B3., 17:19:23 UTC+3 =D0=BF=
=D0=BE=D0=BB=D1=8C=D0=B7=D0=BE=D0=B2=D0=B0=D1=82=D0=B5=D0=BB=D1=8C Micha=C5=
=82=20
Dominiak =D0=BD=D0=B0=D0=BF=D0=B8=D1=81=D0=B0=D0=BB:
>
> That's not how it works. You are supposed to present rationale, otherwise=
=20
> no-one will care about your paper, because without solving an actual=20
> problem, it'll be just a huge waste of time.
>
> On Mon, Dec 11, 2017 at 3:09 PM 'Vlad from Moscow' via ISO C++ Standard -=
=20
> Future Proposals <std-pr...@isocpp.org <javascript:>> wrote:
>
>> Why not?
>>
>> =D1=81=D1=83=D0=B1=D0=B1=D0=BE=D1=82=D0=B0, 9 =D0=B4=D0=B5=D0=BA=D0=B0=
=D0=B1=D1=80=D1=8F 2017 =D0=B3., 18:25:30 UTC+3 =D0=BF=D0=BE=D0=BB=D1=8C=D0=
=B7=D0=BE=D0=B2=D0=B0=D1=82=D0=B5=D0=BB=D1=8C Micha=C5=82 Dominiak=20
>> =D0=BD=D0=B0=D0=BF=D0=B8=D1=81=D0=B0=D0=BB:
>>>
>>> Why?=20
>>>
>>> On Sat, Dec 9, 2017, 3:29 PM 'Vlad from Moscow' via ISO C++ Standard -=
=20
>>> Future Proposals <std-pr...@isocpp.org> wrote:
>>>
>> What about introducing algorithms min, max, and minmax for the template=
=20
>>>> class std::pair?
>>>>
>>>> r. For example
>>>>
>>>> template <typename T>
>>>> constexpr const T & min(const std::pair<T, T> &p)
>>>> {
>>>> return p.second < p.first ? p.second : p.first;
>>>> }
>>>>
>>>> --=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.
>>>
>>>
>>>> To view this discussion on the web visit=20
>>>> https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/132ff725-=
5463-4d9c-a291-3314a56dca50%40isocpp.org=20
>>>> <https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/132ff725=
-5463-4d9c-a291-3314a56dca50%40isocpp.org?utm_medium=3Demail&utm_source=3Df=
ooter>
>>>> .
>>>>
>>> --=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:>.
>> To view this discussion on the web visit=20
>> https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/19271ac8-cb=
01-4290-8126-ca57a87ef4d9%40isocpp.org=20
>> <https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/19271ac8-c=
b01-4290-8126-ca57a87ef4d9%40isocpp.org?utm_medium=3Demail&utm_source=3Dfoo=
ter>
>> .
>>
>
--=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.
To view this discussion on the web visit https://groups.google.com/a/isocpp=
..org/d/msgid/std-proposals/1e097393-dffa-4756-8fa6-f894e254041d%40isocpp.or=
g.
------=_Part_7971_2052815054.1513002715278
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr">I am not discussing "how it works". I want to co=
llect opinions about introducing these functions.<br><br>=D0=BF=D0=BE=D0=BD=
=D0=B5=D0=B4=D0=B5=D0=BB=D1=8C=D0=BD=D0=B8=D0=BA, 11 =D0=B4=D0=B5=D0=BA=D0=
=B0=D0=B1=D1=80=D1=8F 2017 =D0=B3., 17:19:23 UTC+3 =D0=BF=D0=BE=D0=BB=D1=8C=
=D0=B7=D0=BE=D0=B2=D0=B0=D1=82=D0=B5=D0=BB=D1=8C Micha=C5=82 Dominiak =D0=
=BD=D0=B0=D0=BF=D0=B8=D1=81=D0=B0=D0=BB:<blockquote class=3D"gmail_quote" s=
tyle=3D"margin: 0;margin-left: 0.8ex;border-left: 1px #ccc solid;padding-le=
ft: 1ex;"><div dir=3D"ltr">That's not how it works. You are supposed to=
present rationale, otherwise no-one will care about your paper, because wi=
thout solving an actual problem, it'll be just a huge waste of time.</d=
iv><br><div class=3D"gmail_quote"><div dir=3D"ltr">On Mon, Dec 11, 2017 at =
3:09 PM 'Vlad from Moscow' via ISO C++ Standard - Future Proposals =
<<a onmousedown=3D"this.href=3D'javascript:';return true;" oncli=
ck=3D"this.href=3D'javascript:';return true;" href=3D"javascript:" =
target=3D"_blank" rel=3D"nofollow" gdf-obfuscated-mailto=3D"zcF1_pHVBQAJ">s=
td-pr...@isocpp.org</a>> wrote:<br></div><blockquote class=3D"gmail_quot=
e" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">=
<div dir=3D"ltr">Why not?<br><br>=D1=81=D1=83=D0=B1=D0=B1=D0=BE=D1=82=D0=B0=
, 9 =D0=B4=D0=B5=D0=BA=D0=B0=D0=B1=D1=80=D1=8F 2017 =D0=B3., 18:25:30 UTC+3=
=D0=BF=D0=BE=D0=BB=D1=8C=D0=B7=D0=BE=D0=B2=D0=B0=D1=82=D0=B5=D0=BB=D1=8C M=
icha=C5=82 Dominiak =D0=BD=D0=B0=D0=BF=D0=B8=D1=81=D0=B0=D0=BB:<blockquote =
class=3D"gmail_quote" style=3D"margin:0;margin-left:0.8ex;border-left:1px #=
ccc solid;padding-left:1ex"><p dir=3D"ltr">Why? </p>
<br><div class=3D"gmail_quote"></div></blockquote></div><div dir=3D"ltr"><b=
lockquote class=3D"gmail_quote" style=3D"margin:0;margin-left:0.8ex;border-=
left:1px #ccc solid;padding-left:1ex"><div class=3D"gmail_quote"><div dir=
=3D"ltr">On Sat, Dec 9, 2017, 3:29 PM 'Vlad from Moscow' via ISO C+=
+ Standard - Future Proposals <<a rel=3D"nofollow">std-pr...@isocpp.org<=
/a>> wrote:<br></div></div></blockquote></div><div dir=3D"ltr"><blockquo=
te class=3D"gmail_quote" style=3D"margin:0;margin-left:0.8ex;border-left:1p=
x #ccc solid;padding-left:1ex"><div class=3D"gmail_quote"><blockquote class=
=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padd=
ing-left:1ex"><div dir=3D"ltr"><div>What about introducing algorithms min, =
max, and minmax for the template class std::pair?</div><div><br></div><div>=
r. For example</div><div><br></div><div>=C2=A0template <typename T><b=
r>=C2=A0constexpr const T & min(const std::pair<T, T> &p)<br>=
=C2=A0{<br>=C2=A0=C2=A0return p.second < p.first ? p.second : p.first;<b=
r>=C2=A0}<br></div></div>
<p></p>
-- <br>
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals" group.<br></blockquote></div=
></blockquote></div><div dir=3D"ltr"><blockquote class=3D"gmail_quote" styl=
e=3D"margin:0;margin-left:0.8ex;border-left:1px #ccc solid;padding-left:1ex=
"><div class=3D"gmail_quote"><blockquote class=3D"gmail_quote" style=3D"mar=
gin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to <a rel=3D"nofollow">std-proposal...@isocpp.org</a>.<br>
To post to this group, send email to <a rel=3D"nofollow">std-pr...@isocpp.o=
rg</a>.</blockquote></div></blockquote></div><div dir=3D"ltr"><blockquote c=
lass=3D"gmail_quote" style=3D"margin:0;margin-left:0.8ex;border-left:1px #c=
cc solid;padding-left:1ex"><div class=3D"gmail_quote"><blockquote class=3D"=
gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-=
left:1ex"><br>
To view this discussion on the web visit <a onmousedown=3D"this.href=3D'=
;https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/132ff725-5463=
-4d9c-a291-3314a56dca50%40isocpp.org?utm_medium\x3demail\x26utm_source\x3df=
ooter';return true;" onclick=3D"this.href=3D'https://groups.google.=
com/a/isocpp.org/d/msgid/std-proposals/132ff725-5463-4d9c-a291-3314a56dca50=
%40isocpp.org?utm_medium\x3demail\x26utm_source\x3dfooter';return true;=
" href=3D"https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/132f=
f725-5463-4d9c-a291-3314a56dca50%40isocpp.org?utm_medium=3Demail&utm_so=
urce=3Dfooter" target=3D"_blank" rel=3D"nofollow">https://groups.google.com=
/a/<wbr>isocpp.org/d/msgid/std-<wbr>proposals/132ff725-5463-4d9c-<wbr>a291-=
3314a56dca50%40isocpp.org</a><wbr>.<br>
</blockquote></div></blockquote></div>
<p></p>
-- <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 onmousedown=3D"this.href=3D'javascript:';return true;" o=
nclick=3D"this.href=3D'javascript:';return true;" href=3D"javascrip=
t:" target=3D"_blank" rel=3D"nofollow" gdf-obfuscated-mailto=3D"zcF1_pHVBQA=
J">std-proposal...@<wbr>isocpp.org</a>.<br>
To post to this group, send email to <a onmousedown=3D"this.href=3D'jav=
ascript:';return true;" onclick=3D"this.href=3D'javascript:';re=
turn true;" href=3D"javascript:" target=3D"_blank" rel=3D"nofollow" gdf-obf=
uscated-mailto=3D"zcF1_pHVBQAJ">std-pr...@isocpp.org</a>.<br>
To view this discussion on the web visit <a onmousedown=3D"this.href=3D'=
;https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/19271ac8-cb01=
-4290-8126-ca57a87ef4d9%40isocpp.org?utm_medium\x3demail\x26utm_source\x3df=
ooter';return true;" onclick=3D"this.href=3D'https://groups.google.=
com/a/isocpp.org/d/msgid/std-proposals/19271ac8-cb01-4290-8126-ca57a87ef4d9=
%40isocpp.org?utm_medium\x3demail\x26utm_source\x3dfooter';return true;=
" href=3D"https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/1927=
1ac8-cb01-4290-8126-ca57a87ef4d9%40isocpp.org?utm_medium=3Demail&utm_so=
urce=3Dfooter" target=3D"_blank" rel=3D"nofollow">https://groups.google.com=
/a/<wbr>isocpp.org/d/msgid/std-<wbr>proposals/19271ac8-cb01-4290-<wbr>8126-=
ca57a87ef4d9%40isocpp.org</a><wbr>.<br>
</blockquote></div>
</blockquote></div>
<p></p>
-- <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 />
To view this discussion on the web visit <a href=3D"https://groups.google.c=
om/a/isocpp.org/d/msgid/std-proposals/1e097393-dffa-4756-8fa6-f894e254041d%=
40isocpp.org?utm_medium=3Demail&utm_source=3Dfooter">https://groups.google.=
com/a/isocpp.org/d/msgid/std-proposals/1e097393-dffa-4756-8fa6-f894e254041d=
%40isocpp.org</a>.<br />
------=_Part_7971_2052815054.1513002715278--
------=_Part_7970_407575376.1513002715278--
.
Author: Jake Arkinstall <jake.arkinstall@gmail.com>
Date: Mon, 11 Dec 2017 14:43:19 +0000
Raw View
--001a113db2c634bfa80560118ec6
Content-Type: text/plain; charset="UTF-8"
Why not?
I can think of a few reasons.
Firstly, because it doesn't make much sense from a semantics perspective.
The first and second properties of a pair (just like the elements of a
tuple) are not really intended to be compared with one another - they are
wholly separate entities related only by some previous action (e.g. a map
from one to the other, or as multiple return values of a function), and the
two having the comparable type is rare.
If they ARE meant to be compared and are the same type, you should probably
be using a std::array. If they are two *different* types with some defined
comparison operation, you're looking at an edge case for which custom code
is probably suitable (especially as you'd probably want to document it
properly).
Secondly, getting the min and max of a pair is trivial. You can write
min(p.first, p.second) with minimal effort, and is very readable. In fact,
I would consider it considerably more readable than min(p).
--
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.
To view this discussion on the web visit https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/CAC%2B0CCOifG4K%2B8ZSYE9VuVM%2B%2Bj3w_0txck0UFSsdn9H_TD72fg%40mail.gmail.com.
--001a113db2c634bfa80560118ec6
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
<div dir=3D"auto"><div><div class=3D"gmail_extra"><div class=3D"gmail_quote=
"><br type=3D"attribution"><blockquote class=3D"quote" style=3D"margin:0 0 =
0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir=3D"ltr">Why no=
t?<br></div></blockquote></div></div></div><div dir=3D"auto"><br></div><div=
dir=3D"auto">I can think of a few reasons.</div><div dir=3D"auto"><br></di=
v><div dir=3D"auto">Firstly, because it doesn't make much sense from a =
semantics perspective. The first and second properties of a pair (just like=
the elements of a tuple) are not really intended to be compared with one a=
nother - they are wholly separate entities related only by some previous ac=
tion (e.g. a map from one to the other, or as multiple return values of a f=
unction), and the two having the comparable type is rare.</div><div dir=3D"=
auto"><br></div><div dir=3D"auto">If they ARE meant to be compared and are =
the same type, you should probably be using a std::array. If they are two <=
i>different</i> types with some defined comparison operation, you're lo=
oking at an edge case for which custom code is probably suitable (especiall=
y as you'd probably want to document it properly).</div><div dir=3D"aut=
o"><br></div><div dir=3D"auto">Secondly, getting the min and max of a pair =
is trivial. You can write min(p.first, p.second) with minimal effort, and i=
s very readable. In fact, I would consider it considerably more readable th=
an min(p).</div><div dir=3D"auto"><div class=3D"gmail_extra"><div class=3D"=
gmail_quote"><blockquote class=3D"quote" style=3D"margin:0 0 0 .8ex;border-=
left:1px #ccc solid;padding-left:1ex"><div dir=3D"ltr"></div></blockquote><=
/div></div></div></div>
<p></p>
-- <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 />
To view this discussion on the web visit <a href=3D"https://groups.google.c=
om/a/isocpp.org/d/msgid/std-proposals/CAC%2B0CCOifG4K%2B8ZSYE9VuVM%2B%2Bj3w=
_0txck0UFSsdn9H_TD72fg%40mail.gmail.com?utm_medium=3Demail&utm_source=3Dfoo=
ter">https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/CAC%2B0CC=
OifG4K%2B8ZSYE9VuVM%2B%2Bj3w_0txck0UFSsdn9H_TD72fg%40mail.gmail.com</a>.<br=
/>
--001a113db2c634bfa80560118ec6--
.
Author: "'Vlad from Moscow' via ISO C++ Standard - Future Proposals" <std-proposals@isocpp.org>
Date: Mon, 11 Dec 2017 07:11:59 -0800 (PST)
Raw View
------=_Part_8038_2081522203.1513005119579
Content-Type: multipart/alternative;
boundary="----=_Part_8039_1454319309.1513005119580"
------=_Part_8039_1454319309.1513005119580
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
=D0=BF=D0=BE=D0=BD=D0=B5=D0=B4=D0=B5=D0=BB=D1=8C=D0=BD=D0=B8=D0=BA, 11 =D0=
=B4=D0=B5=D0=BA=D0=B0=D0=B1=D1=80=D1=8F 2017 =D0=B3., 17:43:22 UTC+3 =D0=BF=
=D0=BE=D0=BB=D1=8C=D0=B7=D0=BE=D0=B2=D0=B0=D1=82=D0=B5=D0=BB=D1=8C Jake=20
Arkinstall =D0=BD=D0=B0=D0=BF=D0=B8=D1=81=D0=B0=D0=BB:
>
>
> Why not?
>
>
> I can think of a few reasons.
>
> Firstly, because it doesn't make much sense from a semantics perspective.=
=20
> The first and second properties of a pair (just like the elements of a=20
> tuple) are not really intended to be compared with one another - they are=
=20
> wholly separate entities related only by some previous action (e.g. a map=
=20
> from one to the other, or as multiple return values of a function), and t=
he=20
> two having the comparable type is rare.
>
>
I can not agree with this statement.. If elements of a pair have the same=
=20
type then max and min can be considered as properties of the pair.
Consider the following demonstrative program.
#include <iostream>
#include <utility>
#include <algorithm>
#include <iterator>
namespace usr
{
template <typename T>
constexpr const T & min(const std::pair<T, T> &p)
{
return std::min( p.first, p.second );
}
template <typename T>
constexpr const T & max(const std::pair<T, T> &p)
{
return std::max(p.first, p.second);
}
}
int main()
{
std::pair<int, int> arr[] =3D
{
{ 4, 10 }, { 7, 6 }, { 3, 8 }, { 9, 1 }
};
for (const auto &p : arr)
{
std::cout << p.first << ", " << p.second << '\n';
}
std::cout << std::endl;
std::sort(std::begin(arr), std::end(arr),=20
[](const auto &p1, const auto &p2)
{
return usr::max(p1) < usr::max(p2);
});
for (const auto &p : arr)
{
std::cout << p.first << ", " << p.second << '\n';
}
std::cout << std::endl;
std::sort(std::begin(arr), std::end(arr),
[](const auto &p1, const auto &p2)
{
return usr::min(p1) < usr::min(p2);
});
for (const auto &p : arr)
{
std::cout << p.first << ", " << p.second << '\n';
}
std::cout << std::endl;
return 0;
}
Its output is
4, 10
7, 6
3, 8
9, 1
7, 6
3, 8
9, 1
4, 10
9, 1
3, 8
4, 10
7, 6
It is clear from the code that max and min indeed look like properties of=
=20
std::pair.
=20
> If they ARE meant to be compared and are the same type, you should=20
> probably be using a std::array. If they are two *different* types with=20
> some defined comparison operation, you're looking at an edge case for whi=
ch=20
> custom code is probably suitable (especially as you'd probably want to=20
> document it properly).
>
>
Even if two objects have the same type they can be semantically different.=
=20
So it is not always a good idea to substitute std::pair for std::array.
=20
> Secondly, getting the min and max of a pair is trivial. You can write=20
> min(p.first, p.second) with minimal effort, and is very readable. In fact=
,=20
> I would consider it considerably more readable than min(p).
>
Sometimes the more detailed code means its less readability.=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.
To view this discussion on the web visit https://groups.google.com/a/isocpp=
..org/d/msgid/std-proposals/7f1d3b1d-1aa0-4733-b11d-211d5c3501a2%40isocpp.or=
g.
------=_Part_8039_1454319309.1513005119580
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr"><br><br>=D0=BF=D0=BE=D0=BD=D0=B5=D0=B4=D0=B5=D0=BB=D1=8C=
=D0=BD=D0=B8=D0=BA, 11 =D0=B4=D0=B5=D0=BA=D0=B0=D0=B1=D1=80=D1=8F 2017 =D0=
=B3., 17:43:22 UTC+3 =D0=BF=D0=BE=D0=BB=D1=8C=D0=B7=D0=BE=D0=B2=D0=B0=D1=82=
=D0=B5=D0=BB=D1=8C Jake Arkinstall =D0=BD=D0=B0=D0=BF=D0=B8=D1=81=D0=B0=D0=
=BB:<blockquote class=3D"gmail_quote" style=3D"margin: 0;margin-left: 0.8ex=
;border-left: 1px #ccc solid;padding-left: 1ex;"><div dir=3D"auto"><div><di=
v><div class=3D"gmail_quote"><br type=3D"attribution"><blockquote style=3D"=
margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir=3D"=
ltr">Why not?<br></div></blockquote></div></div></div><div dir=3D"auto"><br=
></div><div dir=3D"auto">I can think of a few reasons.</div><div dir=3D"aut=
o"><br></div><div dir=3D"auto">Firstly, because it doesn't make much se=
nse from a semantics perspective. The first and second properties of a pair=
(just like the elements of a tuple) are not really intended to be compared=
with one another - they are wholly separate entities related only by some =
previous action (e.g. a map from one to the other, or as multiple return va=
lues of a function), and the two having the comparable type is rare.</div><=
div dir=3D"auto"><br></div></div></blockquote><div><br></div><div>I can not=
agree with this statement.. If elements of a pair have the same type then =
max and min can be considered as properties of the pair.</div><div><br></di=
v><div>Consider the following demonstrative program.</div><div><br></div><d=
iv>#include <iostream><br>#include <utility><br>#include <al=
gorithm><br>#include <iterator></div><div>namespace usr<br>{<br>=
=C2=A0template <typename T><br>=C2=A0constexpr const T & min(cons=
t std::pair<T, T> &p)<br>=C2=A0{<br>=C2=A0=C2=A0return std::min( =
p.first, p.second );<br>=C2=A0}</div><div>=C2=A0template <typename T>=
<br>=C2=A0constexpr const T & max(const std::pair<T, T> &p)<b=
r>=C2=A0{<br>=C2=A0=C2=A0return std::max(p.first, p.second);<br>=C2=A0}</di=
v><div>}</div><div>int main()<br>{<br>=C2=A0std::pair<int, int> arr[]=
=3D<br>=C2=A0{<br>=C2=A0=C2=A0{ 4, 10 }, { 7, 6 }, { 3, 8 }, { 9, 1 }<br>=
=C2=A0};</div><div><br>=C2=A0for (const auto &p : arr)<br>=C2=A0{<br>=
=C2=A0=C2=A0std::cout << p.first << ", " << p.s=
econd << '\n';<br>=C2=A0}</div><div>=C2=A0std::cout << =
std::endl;</div><div>=C2=A0std::sort(std::begin(arr), std::end(arr), <br>=
=C2=A0=C2=A0[](const auto &p1, const auto &p2)<br>=C2=A0=C2=A0{<br>=
=C2=A0=C2=A0=C2=A0return usr::max(p1) < usr::max(p2);<br>=C2=A0=C2=A0});=
</div><div>=C2=A0for (const auto &p : arr)<br>=C2=A0{<br>=C2=A0=C2=A0st=
d::cout << p.first << ", " << p.second <<=
'\n';<br>=C2=A0}</div><div>=C2=A0std::cout << std::endl;</di=
v><div>=C2=A0std::sort(std::begin(arr), std::end(arr),<br>=C2=A0=C2=A0[](co=
nst auto &p1, const auto &p2)<br>=C2=A0=C2=A0{<br>=C2=A0=C2=A0=C2=
=A0return usr::min(p1) < usr::min(p2);<br>=C2=A0=C2=A0});</div><div>=C2=
=A0for (const auto &p : arr)<br>=C2=A0{<br>=C2=A0=C2=A0std::cout <&l=
t; p.first << ", " << p.second << '\n';=
<br>=C2=A0}</div><div>=C2=A0std::cout << std::endl;</div><div>=C2=A0r=
eturn 0;<br>}<br></div><div><br></div><div>Its output is</div><div><br></di=
v><div>4, 10<br>7, 6<br>3, 8<br>9, 1<br><br>7, 6<br>3, 8<br>9, 1<br>4, 10<b=
r><br>9, 1<br>3, 8<br>4, 10<br>7, 6<br></div><div><br></div><div>It is clea=
r from the code that max and min indeed look like properties of std::pair.<=
/div><div><br></div><div>=C2=A0</div><blockquote class=3D"gmail_quote" styl=
e=3D"margin: 0;margin-left: 0.8ex;border-left: 1px #ccc solid;padding-left:=
1ex;"><div dir=3D"auto"><div dir=3D"auto"></div><div dir=3D"auto">If they =
ARE meant to be compared and are the same type, you should probably be usin=
g a std::array. If they are two <i>different</i> types with some defined co=
mparison operation, you're looking at an edge case for which custom cod=
e is probably suitable (especially as you'd probably want to document i=
t properly).</div><div dir=3D"auto"><br></div></div></blockquote><div><br><=
/div><div>Even if two objects have the same type they can be semantically d=
ifferent. So it is not always a good idea to substitute std::pair for std::=
array.</div><div>=C2=A0</div><blockquote class=3D"gmail_quote" style=3D"mar=
gin: 0;margin-left: 0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;"><=
div dir=3D"auto"><div dir=3D"auto"></div><div dir=3D"auto">Secondly, gettin=
g the min and max of a pair is trivial. You can write min(p.first, p.second=
) with minimal effort, and is very readable. In fact, I would consider it c=
onsiderably more readable than min(p).</div></div></blockquote><div><br></d=
iv><div>Sometimes the more detailed code means its less readability.=C2=A0<=
/div></div>
<p></p>
-- <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 />
To view this discussion on the web visit <a href=3D"https://groups.google.c=
om/a/isocpp.org/d/msgid/std-proposals/7f1d3b1d-1aa0-4733-b11d-211d5c3501a2%=
40isocpp.org?utm_medium=3Demail&utm_source=3Dfooter">https://groups.google.=
com/a/isocpp.org/d/msgid/std-proposals/7f1d3b1d-1aa0-4733-b11d-211d5c3501a2=
%40isocpp.org</a>.<br />
------=_Part_8039_1454319309.1513005119580--
------=_Part_8038_2081522203.1513005119579--
.
Author: Nicol Bolas <jmckesson@gmail.com>
Date: Mon, 11 Dec 2017 07:18:31 -0800 (PST)
Raw View
------=_Part_7889_1823702611.1513005511297
Content-Type: multipart/alternative;
boundary="----=_Part_7890_2008667079.1513005511297"
------=_Part_7890_2008667079.1513005511297
Content-Type: text/plain; charset="UTF-8"
On Monday, December 11, 2017 at 9:31:55 AM UTC-5, Vlad from Moscow wrote:
>
> I am not discussing "how it works". I want to collect opinions about
> introducing these functions.
>
My opinion is that adding these functions without a convincing motivation
is putting the cart before the horse.
>
--
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.
To view this discussion on the web visit https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/2795c7da-f7dc-4ed6-b987-b2886c46aa86%40isocpp.org.
------=_Part_7890_2008667079.1513005511297
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr">On Monday, December 11, 2017 at 9:31:55 AM UTC-5, Vlad fro=
m Moscow 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=
">I am not discussing "how it works". I want to collect opinions =
about introducing these functions.<br></div></blockquote><div><br></div><di=
v>My opinion is that adding these functions without a convincing motivation=
is putting the cart before the horse.<br></div><blockquote class=3D"gmail_=
quote" style=3D"margin: 0;margin-left: 0.8ex;border-left: 1px #ccc solid;pa=
dding-left: 1ex;"><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 class=3D"gmail_quote"><blockquote class=3D"gmail_quote" style=3D"marg=
in:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
</blockquote></div>
</blockquote></div></blockquote></div>
<p></p>
-- <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 />
To view this discussion on the web visit <a href=3D"https://groups.google.c=
om/a/isocpp.org/d/msgid/std-proposals/2795c7da-f7dc-4ed6-b987-b2886c46aa86%=
40isocpp.org?utm_medium=3Demail&utm_source=3Dfooter">https://groups.google.=
com/a/isocpp.org/d/msgid/std-proposals/2795c7da-f7dc-4ed6-b987-b2886c46aa86=
%40isocpp.org</a>.<br />
------=_Part_7890_2008667079.1513005511297--
------=_Part_7889_1823702611.1513005511297--
.
Author: Jake Arkinstall <jake.arkinstall@gmail.com>
Date: Mon, 11 Dec 2017 15:20:49 +0000
Raw View
--f403043e9f8053ec970560121445
Content-Type: text/plain; charset="UTF-8"
On 11 Dec 2017 15:12, "'Vlad from Moscow' via ISO C++ Standard - Future
Proposals" <std-proposals@isocpp.org> wrote:
Even if two objects have the same type they can be semantically different.
This is exactly my reasoning, too. Comparing semantically different objects
makes little sense to me.
Sometimes the more detailed code means its less readability.
I agree. But I strongly disagree that this is one of those occasions.
--
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.
To view this discussion on the web visit https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/CAC%2B0CCOiJ6ZWsDNK0Q8rfYKYofbihyT1m0XTp8BLUWenLQe-fw%40mail.gmail.com.
--f403043e9f8053ec970560121445
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
<div dir=3D"auto"><br><div class=3D"gmail_extra" dir=3D"auto"><br><div clas=
s=3D"gmail_quote">On 11 Dec 2017 15:12, "'Vlad from Moscow' vi=
a ISO C++ Standard - Future Proposals" <<a href=3D"mailto:std-propo=
sals@isocpp.org">std-proposals@isocpp.org</a>> wrote:<br type=3D"attribu=
tion"><blockquote class=3D"quote" style=3D"margin:0 0 0 .8ex;border-left:1p=
x #ccc solid;padding-left:1ex"><div dir=3D"ltr">Even if two objects have th=
e same type they can be semantically different.</div></blockquote></div></d=
iv><div dir=3D"auto"><br></div><div dir=3D"auto">This is exactly my reasoni=
ng, too. Comparing semantically different objects makes little sense to me.=
</div><div dir=3D"auto"><br></div><div class=3D"gmail_extra" dir=3D"auto"><=
div class=3D"gmail_quote"><blockquote class=3D"quote" style=3D"margin:0 0 0=
.8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir=3D"ltr"><div>So=
metimes the more detailed code means its less readability.</div></div></blo=
ckquote></div></div><div dir=3D"auto"><br></div><div dir=3D"auto">I agree. =
But I strongly disagree that this is one of those occasions.</div><div clas=
s=3D"gmail_extra" dir=3D"auto"><br></div></div>
<p></p>
-- <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 />
To view this discussion on the web visit <a href=3D"https://groups.google.c=
om/a/isocpp.org/d/msgid/std-proposals/CAC%2B0CCOiJ6ZWsDNK0Q8rfYKYofbihyT1m0=
XTp8BLUWenLQe-fw%40mail.gmail.com?utm_medium=3Demail&utm_source=3Dfooter">h=
ttps://groups.google.com/a/isocpp.org/d/msgid/std-proposals/CAC%2B0CCOiJ6ZW=
sDNK0Q8rfYKYofbihyT1m0XTp8BLUWenLQe-fw%40mail.gmail.com</a>.<br />
--f403043e9f8053ec970560121445--
.
Author: Dan Raviv <dan.raviv@gmail.com>
Date: Mon, 11 Dec 2017 17:24:12 +0200
Raw View
--94eb2c03b1889ba153056012210f
Content-Type: text/plain; charset="UTF-8"
Perhaps a more general approach, which would also solve your use case
trivially, is a proposal to allow std::pair<T,T> to be convertible to a
range of T?
On Sat, Dec 9, 2017 at 4:29 PM, 'Vlad from Moscow' via ISO C++ Standard -
Future Proposals <std-proposals@isocpp.org> wrote:
> What about introducing algorithms min, max, and minmax for the template
> class std::pair?
>
> r. For example
>
> template <typename T>
> constexpr const T & min(const std::pair<T, T> &p)
> {
> return p.second < p.first ? p.second : p.first;
> }
>
> --
> 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.
> To view this discussion on the web visit https://groups.google.com/a/
> isocpp.org/d/msgid/std-proposals/132ff725-5463-4d9c-
> a291-3314a56dca50%40isocpp.org
> <https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/132ff725-5463-4d9c-a291-3314a56dca50%40isocpp.org?utm_medium=email&utm_source=footer>
> .
>
--
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.
To view this discussion on the web visit https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/CADw4SdR0exO3vSFSjOstcDgfxFFAB1UEU-w5XuG6s2fxmw1CmQ%40mail.gmail.com.
--94eb2c03b1889ba153056012210f
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr">Perhaps a more general approach, which would also solve yo=
ur use case trivially, is a proposal to allow std::pair<T,T> to be co=
nvertible to a range of T?</div><div class=3D"gmail_extra"><br><div class=
=3D"gmail_quote">On Sat, Dec 9, 2017 at 4:29 PM, 'Vlad from Moscow'=
via ISO C++ Standard - Future Proposals <span dir=3D"ltr"><<a href=3D"m=
ailto:std-proposals@isocpp.org" target=3D"_blank">std-proposals@isocpp.org<=
/a>></span> wrote:<br><blockquote class=3D"gmail_quote" style=3D"margin:=
0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir=3D"ltr"><d=
iv>What about introducing algorithms min, max, and minmax for the template =
class std::pair?</div><div><br></div><div>r. For example</div><div><br></di=
v><div>=C2=A0template <typename T><br>=C2=A0constexpr const T & m=
in(const std::pair<T, T> &p)<br>=C2=A0{<br>=C2=A0=C2=A0return p.s=
econd < p.first ? p.second : p.first;<br>=C2=A0}<span class=3D"HOEnZb"><=
font color=3D"#888888"><br></font></span></div></div><span class=3D"HOEnZb"=
><font color=3D"#888888">
<p></p>
-- <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" target=3D"_=
blank">std-proposals+unsubscribe@<wbr>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>
To view this discussion on the web visit <a href=3D"https://groups.google.c=
om/a/isocpp.org/d/msgid/std-proposals/132ff725-5463-4d9c-a291-3314a56dca50%=
40isocpp.org?utm_medium=3Demail&utm_source=3Dfooter" target=3D"_blank">=
https://groups.google.com/a/<wbr>isocpp.org/d/msgid/std-<wbr>proposals/132f=
f725-5463-4d9c-<wbr>a291-3314a56dca50%40isocpp.org</a><wbr>.<br>
</font></span></blockquote></div><br></div>
<p></p>
-- <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 />
To view this discussion on the web visit <a href=3D"https://groups.google.c=
om/a/isocpp.org/d/msgid/std-proposals/CADw4SdR0exO3vSFSjOstcDgfxFFAB1UEU-w5=
XuG6s2fxmw1CmQ%40mail.gmail.com?utm_medium=3Demail&utm_source=3Dfooter">htt=
ps://groups.google.com/a/isocpp.org/d/msgid/std-proposals/CADw4SdR0exO3vSFS=
jOstcDgfxFFAB1UEU-w5XuG6s2fxmw1CmQ%40mail.gmail.com</a>.<br />
--94eb2c03b1889ba153056012210f--
.
Author: Nicol Bolas <jmckesson@gmail.com>
Date: Mon, 11 Dec 2017 08:17:26 -0800 (PST)
Raw View
------=_Part_8001_1148191693.1513009046684
Content-Type: multipart/alternative;
boundary="----=_Part_8002_1906547158.1513009046684"
------=_Part_8002_1906547158.1513009046684
Content-Type: text/plain; charset="UTF-8"
On Monday, December 11, 2017 at 10:24:35 AM UTC-5, Dan Raviv wrote:
>
> Perhaps a more general approach, which would also solve your use case
> trivially, is a proposal to allow std::pair<T,T> to be convertible to a
> range of T?
>
That would be a decidedly odd thing. It would imply that any type that is
layout-compatible with `pair` would be able to do this.
Now, if you want to* generalize* this, such that, for any standard layout
struct, a sequence of `T`s (using their natural alignment) can be converted
into a range, then that might be OK. But I don't see the committee allowing
that.
--
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.
To view this discussion on the web visit https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/353130be-76f3-4008-9b48-250c45e979ac%40isocpp.org.
------=_Part_8002_1906547158.1513009046684
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr">On Monday, December 11, 2017 at 10:24:35 AM UTC-5, Dan Rav=
iv 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">Perh=
aps a more general approach, which would also solve your use case trivially=
, is a proposal to allow std::pair<T,T> to be convertible to a range =
of T?<br></div></blockquote><div><br></div><div>That would be a decidedly o=
dd thing. It would imply that any type that is layout-compatible with `pair=
` would be able to do this.</div><div><br></div><div>Now, if you want to<i>=
generalize</i> this, such that, for any standard layout struct, a sequence=
of `T`s (using their natural alignment) can be converted into a range, the=
n that might be OK. But I don't see the committee allowing that.</div><=
/div>
<p></p>
-- <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 />
To view this discussion on the web visit <a href=3D"https://groups.google.c=
om/a/isocpp.org/d/msgid/std-proposals/353130be-76f3-4008-9b48-250c45e979ac%=
40isocpp.org?utm_medium=3Demail&utm_source=3Dfooter">https://groups.google.=
com/a/isocpp.org/d/msgid/std-proposals/353130be-76f3-4008-9b48-250c45e979ac=
%40isocpp.org</a>.<br />
------=_Part_8002_1906547158.1513009046684--
------=_Part_8001_1148191693.1513009046684--
.