Topic: Multiple return values by tuple conversion
Author: David Krauss <potswa@gmail.com>
Date: Tue, 11 Aug 2015 18:22:29 +0800
Raw View
--Apple-Mail=_236ACE5E-7941-4A0D-B9E9-DDF65E269499
Content-Type: text/plain; charset=UTF-8
Why not let tuples implicitly convert to aggregate types?
Throw anonymous struct objects into the mix and you can emulate multiple return values.
std::tuple< foo_t, bar_t > get_foo_and_bar();
struct { foo_t foo; bar_t bar; } = get_foo_and_bar();
Concepts would allow for eliminating specific dependence on std::tuple from the core language.
--
---
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/.
--Apple-Mail=_236ACE5E-7941-4A0D-B9E9-DDF65E269499
Content-Transfer-Encoding: quoted-printable
Content-Type: text/html; charset=UTF-8
<html><head><meta http-equiv=3D"Content-Type" content=3D"text/html charset=
=3Dus-ascii"></head><body style=3D"word-wrap: break-word; -webkit-nbsp-mode=
: space; -webkit-line-break: after-white-space;" class=3D"">Why not let tup=
les implicitly convert to aggregate types?<div class=3D""><br class=3D""></=
div><div class=3D"">Throw anonymous struct objects into the mix and you can=
emulate multiple return values.<br class=3D""><div class=3D""><div class=
=3D""><br class=3D""></div><div class=3D""><font face=3D"Courier" class=3D"=
">std::tuple< foo_t, bar_t > get_foo_and_bar();</font></div><div clas=
s=3D""><span style=3D"font-family: Courier;" class=3D""><br class=3D""></sp=
an></div><div class=3D""><span style=3D"font-family: Courier;" class=3D"">s=
truct { foo_t foo; bar_t bar; } =3D get_foo_and_bar();</span></div></div></=
div><div class=3D""><br class=3D""></div><div class=3D"">Concepts would all=
ow for eliminating specific dependence on <span style=3D"font-family: =
Courier;" class=3D"">std::tuple</span> from the core language.</div><d=
iv class=3D""><br class=3D""></div></body></html>
<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 />
--Apple-Mail=_236ACE5E-7941-4A0D-B9E9-DDF65E269499--
.
Author: Vlad from Moscow <vlad.moscow@mail.ru>
Date: Tue, 11 Aug 2015 04:41:19 -0700 (PDT)
Raw View
------=_Part_318_892972449.1439293279865
Content-Type: multipart/alternative;
boundary="----=_Part_319_35891437.1439293279872"
------=_Part_319_35891437.1439293279872
Content-Type: text/plain; charset=UTF-8
Isn't it enough to write
foo_t foo;
bar_t bar;
std::tie( foo, bar ) = get_foo_and_bar();
On Tuesday, August 11, 2015 at 1:22:40 PM UTC+3, David Krauss wrote:
> Why not let tuples implicitly convert to aggregate types?
>
> Throw anonymous struct objects into the mix and you can emulate multiple
> return values.
>
> std::tuple< foo_t, bar_t > get_foo_and_bar();
>
> struct { foo_t foo; bar_t bar; } = get_foo_and_bar();
>
> Concepts would allow for eliminating specific dependence on std::tuple from
> the core language.
>
>
--
---
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_319_35891437.1439293279872
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr"><div>Isn't it enough to write</div><div><br></div><div=
>foo_t foo;</div><div>bar_t bar;</div><div><br></div><div>std::tie( foo, ba=
r ) =3D get_foo_and_bar();</div><div><br><br>On Tuesday, August 11, 2015 at=
1:22:40 PM UTC+3, David Krauss wrote:</div><blockquote class=3D"gmail_quot=
e" style=3D"margin: 0px 0px 0px 0.8ex; padding-left: 1ex; border-left-color=
: rgb(204, 204, 204); border-left-width: 1px; border-left-style: solid;"><d=
iv style=3D"-ms-word-wrap: break-word;">Why not let tuples implicitly conve=
rt to aggregate types?<div><br></div><div>Throw anonymous struct objects in=
to the mix and you can emulate multiple return values.<br><div><div><br></d=
iv><div><font face=3D"Courier">std::tuple< foo_t, bar_t > get_foo_and=
_bar();</font></div><div><span style=3D"font-family: Courier;"><br></span><=
/div><div><span style=3D"font-family: Courier;">struct { foo_t foo; bar_t b=
ar; } =3D get_foo_and_bar();</span></div></div></div><div><br></div><div>Co=
ncepts would allow for eliminating specific dependence on=C2=A0<span style=
=3D"font-family: Courier;">std::tuple</span>=C2=A0from the core language.</=
div><div><br></div></div></blockquote></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_319_35891437.1439293279872--
------=_Part_318_892972449.1439293279865--
.
Author: Andrew Tomazos <andrewtomazos@gmail.com>
Date: Tue, 11 Aug 2015 13:47:58 +0200
Raw View
--001a11c264b475c922051d07ac3f
Content-Type: text/plain; charset=UTF-8
This was discussed last year on this list.
On Tue, Aug 11, 2015 at 12:22 PM, David Krauss <potswa@gmail.com> wrote:
> Why not let tuples implicitly convert to aggregate types?
>
> Throw anonymous struct objects into the mix and you can emulate multiple
> return values.
>
> std::tuple< foo_t, bar_t > get_foo_and_bar();
>
> struct { foo_t foo; bar_t bar; } = get_foo_and_bar();
>
> Concepts would allow for eliminating specific dependence on std::tuple from
> the core language.
>
> --
>
> ---
> 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/.
>
--
---
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/.
--001a11c264b475c922051d07ac3f
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr">This was discussed last year on this list.</div><div class=
=3D"gmail_extra"><br><div class=3D"gmail_quote">On Tue, Aug 11, 2015 at 12:=
22 PM, David Krauss <span dir=3D"ltr"><<a href=3D"mailto:potswa@gmail.co=
m" target=3D"_blank">potswa@gmail.com</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 style=3D"word-wrap:break-word">Why not let tuples i=
mplicitly convert to aggregate types?<div><br></div><div>Throw anonymous st=
ruct objects into the mix and you can emulate multiple return values.<br><d=
iv><div><br></div><div><font face=3D"Courier">std::tuple< foo_t, bar_t &=
gt; get_foo_and_bar();</font></div><div><span style=3D"font-family:Courier"=
><br></span></div><div><span style=3D"font-family:Courier">struct { foo_t f=
oo; bar_t bar; } =3D get_foo_and_bar();</span></div></div></div><div><br></=
div><div>Concepts would allow for eliminating specific dependence on=C2=A0<=
span style=3D"font-family:Courier">std::tuple</span>=C2=A0from the core lan=
guage.</div><span class=3D"HOEnZb"><font color=3D"#888888"><div><br></div><=
/font></span></div><span class=3D"HOEnZb"><font color=3D"#888888">
<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" 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>
Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/group/=
std-proposals/" target=3D"_blank">http://groups.google.com/a/isocpp.org/gro=
up/std-proposals/</a>.<br>
</font></span></blockquote></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 />
--001a11c264b475c922051d07ac3f--
.
Author: Andrew Tomazos <andrewtomazos@gmail.com>
Date: Tue, 11 Aug 2015 13:50:17 +0200
Raw View
--f46d04428f0cbaec06051d07b4ae
Content-Type: text/plain; charset=UTF-8
https://groups.google.com/a/isocpp.org/d/msg/std-proposals/4MErTLraVDg/eMX23X06c4UJ
On Tue, Aug 11, 2015 at 1:47 PM, Andrew Tomazos <andrewtomazos@gmail.com>
wrote:
> This was discussed last year on this list.
>
> On Tue, Aug 11, 2015 at 12:22 PM, David Krauss <potswa@gmail.com> wrote:
>
>> Why not let tuples implicitly convert to aggregate types?
>>
>> Throw anonymous struct objects into the mix and you can emulate multiple
>> return values.
>>
>> std::tuple< foo_t, bar_t > get_foo_and_bar();
>>
>> struct { foo_t foo; bar_t bar; } = get_foo_and_bar();
>>
>> Concepts would allow for eliminating specific dependence on std::tuple from
>> the core language.
>>
>> --
>>
>> ---
>> 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/.
>>
>
>
--
---
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/.
--f46d04428f0cbaec06051d07b4ae
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr"><a href=3D"https://groups.google.com/a/isocpp.org/d/msg/st=
d-proposals/4MErTLraVDg/eMX23X06c4UJ">https://groups.google.com/a/isocpp.or=
g/d/msg/std-proposals/4MErTLraVDg/eMX23X06c4UJ</a><br></div><div class=3D"g=
mail_extra"><br><div class=3D"gmail_quote">On Tue, Aug 11, 2015 at 1:47 PM,=
Andrew Tomazos <span dir=3D"ltr"><<a href=3D"mailto:andrewtomazos@gmail=
..com" target=3D"_blank">andrewtomazos@gmail.com</a>></span> wrote:<br><b=
lockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1px =
#ccc solid;padding-left:1ex"><div dir=3D"ltr">This was discussed last year =
on this list.</div><div class=3D"HOEnZb"><div class=3D"h5"><div class=3D"gm=
ail_extra"><br><div class=3D"gmail_quote">On Tue, Aug 11, 2015 at 12:22 PM,=
David Krauss <span dir=3D"ltr"><<a href=3D"mailto:potswa@gmail.com" tar=
get=3D"_blank">potswa@gmail.com</a>></span> wrote:<br><blockquote class=
=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padd=
ing-left:1ex"><div style=3D"word-wrap:break-word">Why not let tuples implic=
itly convert to aggregate types?<div><br></div><div>Throw anonymous struct =
objects into the mix and you can emulate multiple return values.<br><div><d=
iv><br></div><div><font face=3D"Courier">std::tuple< foo_t, bar_t > g=
et_foo_and_bar();</font></div><div><span style=3D"font-family:Courier"><br>=
</span></div><div><span style=3D"font-family:Courier">struct { foo_t foo; b=
ar_t bar; } =3D get_foo_and_bar();</span></div></div></div><div><br></div><=
div>Concepts would allow for eliminating specific dependence on=C2=A0<span =
style=3D"font-family:Courier">std::tuple</span>=C2=A0from the core language=
..</div><span><font color=3D"#888888"><div><br></div></font></span></div><sp=
an><font color=3D"#888888">
<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" 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>
Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/group/=
std-proposals/" target=3D"_blank">http://groups.google.com/a/isocpp.org/gro=
up/std-proposals/</a>.<br>
</font></span></blockquote></div><br></div>
</div></div></blockquote></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 />
--f46d04428f0cbaec06051d07b4ae--
.
Author: Matthew Woehlke <mwoehlke.floss@gmail.com>
Date: Tue, 11 Aug 2015 11:32:29 -0400
Raw View
On 2015-08-11 06:22, David Krauss wrote:
> Why not let tuples implicitly convert to aggregate types?
>
> Throw anonymous struct objects into the mix and you can emulate multiple return values.
>
> std::tuple< foo_t, bar_t > get_foo_and_bar();
>
> struct { foo_t foo; bar_t bar; } = get_foo_and_bar();
>
> Concepts would allow for eliminating specific dependence on std::tuple from the core language.
There was a loooong discussion on this back in May ("Core Language
feature: Multiple assignments from multiple return values via tuple").
Brief summary... I would much rather write:
std::tuple<int, int> get_ints();
Point2i get_point();
std::map<int, int> get_map();
int const {a, b} = get_ints();
int const {x, y} = get_point();
for (auto const& { key, value } : get_map())
Nicol Bolas was *extremely* adamant that unpacking is not a problem to
be solved and multiple return values should be first class citizens. (I
strongly disagree that unpacking should not be solved, and with the
assertion that the two are necessarily tightly coupled; I assert that
they can be implemented orthogonally without detriment.)
Anyway, I think we have the same general idea, except that I would allow
decomposition of any type for which there exists a definition of how
unpacking happens (preferably not required to be a class member), not
just std::tuple. I'd *prefer* if there are as few extraneous
keywords/typenames as possible, but this isn't a critical point. (I
assume your example intends that the names 'foo' and 'bar' are injected
into the current scope? I guess they have to be, since the struct is not
named.)
In particular, at least this should be allowed:
struct { auto&& foo; auto&& bar; } = get_foo_and_bar();
--
Matthew
--
---
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/.
.
Author: David Krauss <potswa@gmail.com>
Date: Tue, 11 Aug 2015 23:36:49 +0800
Raw View
--Apple-Mail=_AB5C0370-18A4-4AD6-85FD-E034AB08612E
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain; charset=UTF-8
> On 2015=E2=80=9308=E2=80=9311, at 7:47 PM, Andrew Tomazos <andrewtomazos@=
gmail.com> wrote:
>=20
> This was discussed last year on this list. https://groups.google.com/a/is=
ocpp.org/d/msg/std-proposals/4MErTLraVDg/eMX23X06c4UJ <https://groups.googl=
e.com/a/isocpp.org/d/msg/std-proposals/4MErTLraVDg/eMX23X06c4UJ>
That thread seems to be proposing a new bracket-based syntax, and consideri=
ng whether it should map to a class type which converts from tuple.
My suggestion is to use existing (semantically invalid) syntax, and add an =
enhancement to all aggregate classes. Perhaps even C-style arrays too, whic=
h are also aggregates.
Still, the obvious objection from that thread applies: a tuple (or any tupl=
e-like thing) is an ordinary object, and it=E2=80=99s messy to imbue it wit=
h special semantics. Some sort of glue is needed, at least. I don=E2=80=99t=
have a complete solution, but just wanted to see what folks thought about =
the syntax.
--=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/.
--Apple-Mail=_AB5C0370-18A4-4AD6-85FD-E034AB08612E
Content-Transfer-Encoding: quoted-printable
Content-Type: text/html; charset=UTF-8
<html><head><meta http-equiv=3D"Content-Type" content=3D"text/html charset=
=3Dutf-8"></head><body style=3D"word-wrap: break-word; -webkit-nbsp-mode: s=
pace; -webkit-line-break: after-white-space;" class=3D""><div class=3D""><b=
r class=3D""></div><div><blockquote type=3D"cite" class=3D""><div class=3D"=
">On 2015=E2=80=9308=E2=80=9311, at 7:47 PM, Andrew Tomazos <<a href=3D"=
mailto:andrewtomazos@gmail.com" class=3D"">andrewtomazos@gmail.com</a>> =
wrote:</div><br class=3D"Apple-interchange-newline"><div class=3D""><div di=
r=3D"ltr" class=3D"">This was discussed last year on this list. <a hre=
f=3D"https://groups.google.com/a/isocpp.org/d/msg/std-proposals/4MErTLraVDg=
/eMX23X06c4UJ" class=3D"">https://groups.google.com/a/isocpp.org/d/msg/std-=
proposals/4MErTLraVDg/eMX23X06c4UJ</a></div></div></blockquote></div><br cl=
ass=3D""><div class=3D"">That thread seems to be proposing a new bracket-ba=
sed syntax, and considering whether it should map to a class type which con=
verts from tuple.</div><div class=3D""><br class=3D""></div><div class=3D""=
>My suggestion is to use existing (semantically invalid) syntax, and add an=
enhancement to all aggregate classes. Perhaps even C-style arrays too, whi=
ch are also aggregates.</div><div class=3D""><br class=3D""></div><div clas=
s=3D"">Still, the obvious objection from that thread applies: a tuple (or a=
ny tuple-like thing) is an ordinary object, and it=E2=80=99s messy to imbue=
it with special semantics. Some sort of glue is needed, at least. I don=E2=
=80=99t have a complete solution, but just wanted to see what folks thought=
about the syntax.</div><div class=3D""><br class=3D""></div></body></html>
<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 />
--Apple-Mail=_AB5C0370-18A4-4AD6-85FD-E034AB08612E--
.
Author: Andrew Tomazos <andrewtomazos@gmail.com>
Date: Tue, 11 Aug 2015 17:54:02 +0200
Raw View
--001a113edac46f464e051d0b1cde
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
I meant this thread:
https://groups.google.com/a/isocpp.org/d/msg/std-proposals/4yWRnzX7J7Y/sS0q=
BxcK3hUJ
subject: Unpacking syntax for tuples using auto
On Tue, Aug 11, 2015 at 5:36 PM, David Krauss <potswa@gmail.com> wrote:
>
> On 2015=E2=80=9308=E2=80=9311, at 7:47 PM, Andrew Tomazos <andrewtomazos@=
gmail.com> wrote:
>
> This was discussed last year on this list.
> https://groups.google.com/a/isocpp.org/d/msg/std-proposals/4MErTLraVDg/eM=
X23X06c4UJ
>
>
> That thread seems to be proposing a new bracket-based syntax, and
> considering whether it should map to a class type which converts from tup=
le.
>
> My suggestion is to use existing (semantically invalid) syntax, and add a=
n
> enhancement to all aggregate classes. Perhaps even C-style arrays too,
> which are also aggregates.
>
> Still, the obvious objection from that thread applies: a tuple (or any
> tuple-like thing) is an ordinary object, and it=E2=80=99s messy to imbue =
it with
> special semantics. Some sort of glue is needed, at least. I don=E2=80=99t=
have a
> complete solution, but just wanted to see what folks thought about the
> syntax.
>
> --
>
> ---
> 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/.
>
--=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/.
--001a113edac46f464e051d0b1cde
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr">I meant this thread:<div><br></div><div><a href=3D"https:/=
/groups.google.com/a/isocpp.org/d/msg/std-proposals/4yWRnzX7J7Y/sS0qBxcK3hU=
J">https://groups.google.com/a/isocpp.org/d/msg/std-proposals/4yWRnzX7J7Y/s=
S0qBxcK3hUJ</a></div><div><br></div><div><div>=C2=A0 subject: Unpacking syn=
tax for tuples using auto<br></div></div><div><br></div><div><div class=3D"=
gmail_extra"><div class=3D"gmail_quote">On Tue, Aug 11, 2015 at 5:36 PM, Da=
vid Krauss <span dir=3D"ltr"><<a href=3D"mailto:potswa@gmail.com" target=
=3D"_blank">potswa@gmail.com</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 style=3D"word-wrap:break-word"><div><br></div><div><blockquo=
te type=3D"cite"><div>On 2015=E2=80=9308=E2=80=9311, at 7:47 PM, Andrew Tom=
azos <<a href=3D"mailto:andrewtomazos@gmail.com" target=3D"_blank">andre=
wtomazos@gmail.com</a>> wrote:</div><br><div><div dir=3D"ltr">This was d=
iscussed last year on this list.=C2=A0<a href=3D"https://groups.google.com/=
a/isocpp.org/d/msg/std-proposals/4MErTLraVDg/eMX23X06c4UJ" target=3D"_blank=
">https://groups.google.com/a/isocpp.org/d/msg/std-proposals/4MErTLraVDg/eM=
X23X06c4UJ</a></div></div></blockquote></div><br><div>That thread seems to =
be proposing a new bracket-based syntax, and considering whether it should =
map to a class type which converts from tuple.</div><div><br></div><div>My =
suggestion is to use existing (semantically invalid) syntax, and add an enh=
ancement to all aggregate classes. Perhaps even C-style arrays too, which a=
re also aggregates.</div><div><br></div><div>Still, the obvious objection f=
rom that thread applies: a tuple (or any tuple-like thing) is an ordinary o=
bject, and it=E2=80=99s messy to imbue it with special semantics. Some sort=
of glue is needed, at least. I don=E2=80=99t have a complete solution, but=
just wanted to see what folks thought about the syntax.</div><div><br></di=
v></div><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" 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>
Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/group/=
std-proposals/" target=3D"_blank">http://groups.google.com/a/isocpp.org/gro=
up/std-proposals/</a>.<br>
</div></div></blockquote></div><br></div></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 />
--001a113edac46f464e051d0b1cde--
.
Author: David Krauss <potswa@gmail.com>
Date: Wed, 12 Aug 2015 05:37:18 +0800
Raw View
--Apple-Mail=_9E266F34-DCCB-4BDD-8332-A6FEAD9401A8
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain; charset=UTF-8
Ah, nice. Richard suggested the same thing, but it doesn=E2=80=99t look lik=
e it gained traction in that thread. Ville later suggested avoiding too muc=
h new syntax, but the solution and the problem weren=E2=80=99t directly int=
roduced to each other :P .
The other part of this, which I didn=E2=80=99t mention yet, is declaring th=
e =E2=80=9Cmembers=E2=80=9D as auto. Class template parameter deduction fro=
m constructor arguments could help with that, as long as the initialization=
is according to some kind of implicit constructor.
> On 2015=E2=80=9308=E2=80=9311, at 11:54 PM, Andrew Tomazos <andrewtomazos=
@gmail.com> wrote:
>=20
> I meant this thread:
>=20
> https://groups.google.com/a/isocpp.org/d/msg/std-proposals/4yWRnzX7J7Y/sS=
0qBxcK3hUJ <https://groups.google.com/a/isocpp.org/d/msg/std-proposals/4yWR=
nzX7J7Y/sS0qBxcK3hUJ>
>=20
> subject: Unpacking syntax for tuples using auto
>=20
> On Tue, Aug 11, 2015 at 5:36 PM, David Krauss <potswa@gmail.com <mailto:p=
otswa@gmail.com>> wrote:
>=20
>> On 2015=E2=80=9308=E2=80=9311, at 7:47 PM, Andrew Tomazos <andrewtomazos=
@gmail.com <mailto:andrewtomazos@gmail.com>> wrote:
>>=20
>> This was discussed last year on this list. https://groups.google.com/a/i=
socpp.org/d/msg/std-proposals/4MErTLraVDg/eMX23X06c4UJ <https://groups.goog=
le.com/a/isocpp.org/d/msg/std-proposals/4MErTLraVDg/eMX23X06c4UJ>
> That thread seems to be proposing a new bracket-based syntax, and conside=
ring whether it should map to a class type which converts from tuple.
>=20
> My suggestion is to use existing (semantically invalid) syntax, and add a=
n enhancement to all aggregate classes. Perhaps even C-style arrays too, wh=
ich are also aggregates.
>=20
> Still, the obvious objection from that thread applies: a tuple (or any tu=
ple-like thing) is an ordinary object, and it=E2=80=99s messy to imbue it w=
ith special semantics. Some sort of glue is needed, at least. I don=E2=80=
=99t have a complete solution, but just wanted to see what folks thought ab=
out the syntax.
--=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/.
--Apple-Mail=_9E266F34-DCCB-4BDD-8332-A6FEAD9401A8
Content-Transfer-Encoding: quoted-printable
Content-Type: text/html; charset=UTF-8
<html><head><meta http-equiv=3D"Content-Type" content=3D"text/html charset=
=3Dutf-8"></head><body style=3D"word-wrap: break-word; -webkit-nbsp-mode: s=
pace; -webkit-line-break: after-white-space;" class=3D""><div class=3D"">Ah=
, nice. Richard suggested the same thing, but it doesn=E2=80=99t look like =
it gained traction in that thread. Ville later suggested avoiding too much =
new syntax, but the solution and the problem weren=E2=80=99t directly intro=
duced to each other :P .</div><div class=3D""><br class=3D""></div><div cla=
ss=3D"">The other part of this, which I didn=E2=80=99t mention yet, is decl=
aring the =E2=80=9Cmembers=E2=80=9D as <font face=3D"Courier" class=3D"">au=
to</font>. Class template parameter deduction from constructor arguments co=
uld help with that, as long as the initialization is according to some kind=
of implicit constructor.</div><div class=3D""><br class=3D""></div><div cl=
ass=3D""><br class=3D""></div><div><blockquote type=3D"cite" class=3D""><di=
v class=3D"">On 2015=E2=80=9308=E2=80=9311, at 11:54 PM, Andrew Tomazos <=
;<a href=3D"mailto:andrewtomazos@gmail.com" class=3D"">andrewtomazos@gmail.=
com</a>> wrote:</div><br class=3D"Apple-interchange-newline"><div class=
=3D""><div dir=3D"ltr" class=3D"">I meant this thread:<div class=3D""><br c=
lass=3D""></div><div class=3D""><a href=3D"https://groups.google.com/a/isoc=
pp.org/d/msg/std-proposals/4yWRnzX7J7Y/sS0qBxcK3hUJ" class=3D"">https://gro=
ups.google.com/a/isocpp.org/d/msg/std-proposals/4yWRnzX7J7Y/sS0qBxcK3hUJ</a=
></div><div class=3D""><br class=3D""></div><div class=3D""><div class=3D""=
> subject: Unpacking syntax for tuples using auto<br class=3D""></div=
></div><div class=3D""><br class=3D""></div><div class=3D""><div class=3D"g=
mail_extra"><div class=3D"gmail_quote">On Tue, Aug 11, 2015 at 5:36 PM, Dav=
id Krauss <span dir=3D"ltr" class=3D""><<a href=3D"mailto:potswa@gmail.c=
om" target=3D"_blank" class=3D"">potswa@gmail.com</a>></span> wrote:<br =
class=3D""><blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;bor=
der-left:1px #ccc solid;padding-left:1ex"><div style=3D"word-wrap:break-wor=
d" class=3D""><div class=3D""><br class=3D""></div><div class=3D""><blockqu=
ote type=3D"cite" class=3D""><div class=3D"">On 2015=E2=80=9308=E2=80=9311,=
at 7:47 PM, Andrew Tomazos <<a href=3D"mailto:andrewtomazos@gmail.com" =
target=3D"_blank" class=3D"">andrewtomazos@gmail.com</a>> wrote:</div><b=
r class=3D""><div class=3D""><div dir=3D"ltr" class=3D"">This was discussed=
last year on this list. <a href=3D"https://groups.google.com/a/isocpp=
..org/d/msg/std-proposals/4MErTLraVDg/eMX23X06c4UJ" target=3D"_blank" class=
=3D"">https://groups.google.com/a/isocpp.org/d/msg/std-proposals/4MErTLraVD=
g/eMX23X06c4UJ</a></div></div></blockquote></div><br class=3D""><div class=
=3D"">That thread seems to be proposing a new bracket-based syntax, and con=
sidering whether it should map to a class type which converts from tuple.</=
div><div class=3D""><br class=3D""></div><div class=3D"">My suggestion is t=
o use existing (semantically invalid) syntax, and add an enhancement to all=
aggregate classes. Perhaps even C-style arrays too, which are also aggrega=
tes.</div><div class=3D""><br class=3D""></div><div class=3D"">Still, the o=
bvious objection from that thread applies: a tuple (or any tuple-like thing=
) is an ordinary object, and it=E2=80=99s messy to imbue it with special se=
mantics. Some sort of glue is needed, at least. I don=E2=80=99t have a comp=
lete solution, but just wanted to see what folks thought about the syntax.<=
/div></div></blockquote></div></div></div></div></div></blockquote></div><b=
r class=3D""></body></html>
<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 />
--Apple-Mail=_9E266F34-DCCB-4BDD-8332-A6FEAD9401A8--
.