Topic: Proposal: allow idiomatic use of += and 'continue


Author: "'Walt Karas' via ISO C++ Standard - Future Proposals" <std-proposals@isocpp.org>
Date: Fri, 14 Oct 2016 10:29:14 -0700 (PDT)
Raw View
------=_Part_1096_1613096854.1476466154929
Content-Type: multipart/alternative;
 boundary="----=_Part_1097_65837686.1476466154929"

------=_Part_1097_65837686.1476466154929
Content-Type: text/plain; charset=UTF-8

This

enum { a = 10, b += 5 };

would be equivalent to:

enum { a = 10, b = 15 };

With the above definition, this:

continue a

would be equivalent to:

b

(and:

continue b

could be an anonymous constant, whose value would be the "next" value, 16
in the example, after b.)

My immediate use for this would be to eliminate the need for dummy
structures of char arrays to define bit field formats in:

https://github.com/wkaras/C-plus-plus-library-bit-fields/blob/master/Bitfield.pdf

--
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/e7941551-2d30-4a0a-aa76-2cdfe9b50438%40isocpp.org.

------=_Part_1097_65837686.1476466154929
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div>This</div><div><br></div><div>enum { a =3D 10, b +=3D=
 5 };</div><div><br></div><div>would be equivalent to:</div><div><br></div>=
<div>enum { a =3D 10, b =3D 15 };</div><div><br></div><div>With the above d=
efinition, this:</div><div><br></div><div>continue a</div><div><br></div><d=
iv>would be equivalent to:</div><div><br></div><div>b</div><div><br></div><=
div>(and:</div><div><br></div><div>continue b</div><div><br></div><div>coul=
d be an anonymous constant, whose value would be the &quot;next&quot; value=
, 16 in the example, after b.)</div><div><br></div><div>My immediate use fo=
r this would be to eliminate the need for dummy structures of char arrays t=
o define bit field formats in:<br></div><div><br></div><div>https://github.=
com/wkaras/C-plus-plus-library-bit-fields/blob/master/Bitfield.pdf<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/e7941551-2d30-4a0a-aa76-2cdfe9b50438%=
40isocpp.org?utm_medium=3Demail&utm_source=3Dfooter">https://groups.google.=
com/a/isocpp.org/d/msgid/std-proposals/e7941551-2d30-4a0a-aa76-2cdfe9b50438=
%40isocpp.org</a>.<br />

------=_Part_1097_65837686.1476466154929--

------=_Part_1096_1613096854.1476466154929--

.