Topic: More general std::pair comparison
Author: Jeremy Maitin-Shepard <jeremy@jeremyms.com>
Date: Thu, 12 Nov 2015 17:27:57 -0800 (PST)
Raw View
------=_Part_7024_1381160132.1447378077987
Content-Type: multipart/alternative;
boundary="----=_Part_7025_1700006652.1447378077987"
------=_Part_7025_1700006652.1447378077987
Content-Type: text/plain; charset=UTF-8
There is currently a very annoying limitation on how std::pair comparison
operators are defined, that differs from how they are defined on std::tuple:
#include <utility>
void foo() {
std::pair<int,double> x(1, 3.0);
std::pair<const int&,const double&> y = x;
x == y;
}
This generates an error.
It seems this is a clear defect that could be corrected by adding
comparison operators for std::pair<A1,A2> and std::pair<B1,B2> whenever the
comparisons of A1/B1 and A2/B2 are valid.
--
---
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_7025_1700006652.1447378077987
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr">There is currently a very annoying limitation on how std::=
pair comparison operators are defined, that differs from how they are defin=
ed on std::tuple:<br><br>#include <utility><br><br>void foo() {<br> =
=C2=A0std::pair<int,double> x(1, 3.0);<br> =C2=A0std::pair<const i=
nt&,const double&> y =3D x;<br> =C2=A0x =3D=3D y;<br>}<br><br>Th=
is generates an error.<br><br>It seems this is a clear defect that could be=
corrected by adding comparison operators for std::pair<A1,A2> and st=
d::pair<B1,B2> whenever the comparisons of A1/B1 and A2/B2 are valid.=
<br><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_7025_1700006652.1447378077987--
------=_Part_7024_1381160132.1447378077987--
.