Topic: allow enums in std::integer_sequence<class T, T...>


Author: huili80@gmail.com
Date: Sun, 6 Jan 2019 05:55:07 -0800 (PST)
Raw View
------=_Part_1354_1716587384.1546782907693
Content-Type: multipart/alternative;
 boundary="----=_Part_1355_1006439652.1546782907693"

------=_Part_1355_1006439652.1546782907693
Content-Type: text/plain; charset="UTF-8"

According to the standard, in std::integer_sequence<class T,T...>, T must
be an integer type. However, it would be very useful to allow enums too.
I can't think of any good reason why enums must be banned there; and in
fact std::integral_constant<class T, T> allows T to be an enum type.

--
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/8913f62c-8818-46a4-8426-87660d24d989%40isocpp.org.

------=_Part_1355_1006439652.1546782907693
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">According to the standard, in std::integer_sequence&lt;cla=
ss T,T...&gt;, T must be an integer type. However, it would be very useful =
to allow enums too.<div>I can&#39;t think of any good reason why enums must=
 be banned there; and in fact std::integral_constant&lt;class T, T&gt; allo=
ws T to be an enum type.</div><div><br></div></div>

<p></p>

-- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals&quot; 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/8913f62c-8818-46a4-8426-87660d24d989%=
40isocpp.org?utm_medium=3Demail&utm_source=3Dfooter">https://groups.google.=
com/a/isocpp.org/d/msgid/std-proposals/8913f62c-8818-46a4-8426-87660d24d989=
%40isocpp.org</a>.<br />

------=_Part_1355_1006439652.1546782907693--

------=_Part_1354_1716587384.1546782907693--

.


Author: Barry Revzin <barry.revzin@gmail.com>
Date: Sun, 6 Jan 2019 08:38:12 -0800 (PST)
Raw View
------=_Part_1376_1209456012.1546792692411
Content-Type: multipart/alternative;
 boundary="----=_Part_1377_1497285061.1546792692411"

------=_Part_1377_1497285061.1546792692411
Content-Type: text/plain; charset="UTF-8"

On Sunday, January 6, 2019 at 7:55:07 AM UTC-6, hui...@gmail.com wrote:
>
> According to the standard, in std::integer_sequence<class T,T...>, T must
> be an integer type. However, it would be very useful to allow enums too.
> I can't think of any good reason why enums must be banned there; and in
> fact std::integral_constant<class T, T> allows T to be an enum type.
>
>
What's the *positive *motivation for the change? What's the use-case for
allowing enums?

--
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/11be50bf-0922-4328-9006-9c0b2cdbb33b%40isocpp.org.

------=_Part_1377_1497285061.1546792692411
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">On Sunday, January 6, 2019 at 7:55:07 AM UTC-6, hui...@gma=
il.com wrote:<blockquote class=3D"gmail_quote" style=3D"margin: 0;margin-le=
ft: 0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;"><div dir=3D"ltr">=
According to the standard, in std::integer_sequence&lt;class T,T...&gt;, T =
must be an integer type. However, it would be very useful to allow enums to=
o.<div>I can&#39;t think of any good reason why enums must be banned there;=
 and in fact std::integral_constant&lt;class T, T&gt; allows T to be an enu=
m type.</div><div><br></div></div></blockquote><div><br></div><div>What&#39=
;s the <i>positive </i>motivation for the change? What&#39;s the use-case f=
or allowing enums?=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&quot; 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/11be50bf-0922-4328-9006-9c0b2cdbb33b%=
40isocpp.org?utm_medium=3Demail&utm_source=3Dfooter">https://groups.google.=
com/a/isocpp.org/d/msgid/std-proposals/11be50bf-0922-4328-9006-9c0b2cdbb33b=
%40isocpp.org</a>.<br />

------=_Part_1377_1497285061.1546792692411--

------=_Part_1376_1209456012.1546792692411--

.