Topic: Comments on N3584 Wording for Addressing Tuples
Author: Jonathan Wakely <cxx@kayari.org>
Date: Thu, 16 May 2013 03:24:48 -0700 (PDT)
Raw View
------=_Part_6166_2163842.1368699888907
Content-Type: text/plain; charset=ISO-8859-1
On Wednesday, May 15, 2013 6:40:51 AM UTC+1, Vicente J. Botet Escriba wrote:
>
>
> I would reserve the get<type>() syntax for named tuples
>
Too late :-)
Unless there's a National Body comment objecting to it, C++14 will include
the N3584 feature.
>
> struct f1{};
> struct f2{};
> struct f3{};
> tuple<tagged<string, f1>, tagged<string, f2>, tagged<int, f3>> t("foo",
> "bar", 7);
> int i = get<f2>(t); // i == 7
>
>
It might be possible to have both, if the tag types f1, f2 and f3 have to
be specializations of a particular template.
--
---
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/?hl=en.
------=_Part_6166_2163842.1368699888907
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
<br><br>On Wednesday, May 15, 2013 6:40:51 AM UTC+1, Vicente J. Botet Escri=
ba wrote:<blockquote class=3D"gmail_quote" style=3D"margin: 0;margin-left: =
0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;">
=20
=20
=20
<div bgcolor=3D"#FFFFFF" text=3D"#000000"><br>
I would reserve the get<type>() syntax for named tuples<br></div>=
</blockquote><div><br>Too late :-)<br><br>Unless there's a National Body co=
mment objecting to it, C++14 will include the N3584 feature.<br> <br><=
/div><blockquote class=3D"gmail_quote" style=3D"margin: 0;margin-left: 0.8e=
x;border-left: 1px #ccc solid;padding-left: 1ex;"><div bgcolor=3D"#FFFFFF" =
text=3D"#000000">
<br>
struct f1{};<br>
struct f2{};<br>
struct f3{};<br>
<code></code><code>tuple<tagged<string, f1>,
tagged<string, f2>, tagged<int, f3>> t("foo",
"bar", 7);
</code><br>
<code>int i =3D get<f2>(t);<span> // i =3D=3D 7</span>
<br>
</code><br></div></blockquote><br>It might be possible to have both, if=
the tag types f1, f2 and f3 have to be specializations of a particular tem=
plate.<br><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/?hl=3Den">http://groups.google.com/a/isocpp.org/group/std-pro=
posals/?hl=3Den</a>.<br />
<br />
<br />
------=_Part_6166_2163842.1368699888907--
.