Send Std-Proposals mailing list submissions to
std-proposals@lists.isocpp.org
To subscribe or unsubscribe via the World Wide Web, visit
https://lists.isocpp.org/mailman/listinfo.cgi/std-proposals
or, via email, send a message with subject or body 'help' to
std-proposals-request@lists.isocpp.org
You can reach the person managing the list at
std-proposals-owner@lists.isocpp.org
When replying, please edit your Subject line so it is more specific
than "Re: Contents of Std-Proposals digest..."
Today's Topics:
1. Revision 1 of scoped enum enhancements (Alexander Christensen)
2. Re: Revision 1 of scoped enum enhancements (Sebastian Wittmeier)
----------------------------------------------------------------------
Message: 1
Date: Sun, 30 Jul 2023 16:27:51 +0000
From: Alexander Christensen <alex_c007@hotmail.com>
To: "std-proposals@lists.isocpp.org" <std-proposals@lists.isocpp.org>
Subject: [std-proposals] Revision 1 of scoped enum enhancements
Message-ID:
<AM0PR09MB4291B27C94934ACA5F1430AFD404A@AM0PR09MB4291.eurprd09.prod.outlook.com>
Content-Type: text/plain; charset="iso-8859-1"
Hi all,
After a (longer than expected) period of thinking my initial proposal through, I here send a "revision 1".
I posted some time during winter 2021/22 a draft for how we can enhance scoped enums, and notably here - extended with bitmasking, as well as a lot of cleanup and testing.
It is a compiled pdf document of 15 pages, so I present a link:
https://github.com/alexpanter/cpp-enum-proposal/blob/master/revision-1/report.pdf
I'm really looking forward to your feedback.
Best,
Alexander
-------------- next part --------------
HTML attachment scrubbed and removed
------------------------------
Message: 2
Date: Mon, 31 Jul 2023 06:38:58 +0200
From: Sebastian Wittmeier <wittmeier@projectalpha.org>
To: std-proposals@lists.isocpp.org <std-proposals@lists.isocpp.org>
Subject: Re: [std-proposals] Revision 1 of scoped enum enhancements
Message-ID:
<zarafa.64c73ae2.08d5.7133c44d3bb78d0c@lvps176-28-11-36.dedicated.hosteurope.de>
Content-Type: text/plain; charset="utf-8"
Hi Alexander,
some feedback to your enum proposal:
?
Cardinality/automatic end
=====================
When measuring the cardinality to add to the end or create an end marker as =cardinality+1, there are (at least) three cases:
?- number of values defined so far
?- number of values defined so far - 1 (if the first value is 0)
?- maximum underlying value so far (if gaps are used)
?
Perhaps the end should not be defined as an enum value itself.
?
Bitmask enums
=============
For bit-masking enums often constant flag-combinations are defined, including no flags, which equals 0 in the underlying type or all flags, which not necessarily (depending on whether the bits are all used) equals -1.
In your notation those would be constants of the templated class-type. But perhaps it would make sense to mention those constants. Often those bitflag combination constants are currently put into the same enum as the flags and can contain 0. Your templated
class would give those another type.
?
The templated class in its current form does not support bitfields, where one flag needs more than one bit.
?
Sebastian
?
?
-----Urspr?ngliche Nachricht-----
Von:Alexander Christensen via Std-Proposals <std-proposals@lists.isocpp.org>
Gesendet:So 30.07.2023 18:28
Betreff:[std-proposals] Revision 1 of scoped enum enhancements
An:std-proposals@lists.isocpp.org;
CC:Alexander Christensen <alex_c007@hotmail.com>;
Hi all,
?
After a (longer than expected) period of thinking my initial proposal through, I here send a "revision 1".
I posted some time during winter 2021/22 a draft for how we can enhance scoped enums, and notably here - extended with bitmasking, as well as a lot of cleanup and testing.
?
It is a compiled pdf document of 15 pages, so I present a link:
https://github.com/alexpanter/cpp-enum-proposal/blob/master/revision-1/report.pdf
?
I'm really looking forward to your feedback.
?
Best,
Alexander
?
--
Std-Proposals mailing list
Std-Proposals@lists.isocpp.org
https://lists.isocpp.org/mailman/listinfo.cgi/std-proposals
-------------- next part --------------
HTML attachment scrubbed and removed
------------------------------
Subject: Digest Footer
Std-Proposals mailing list
Std-Proposals@lists.isocpp.org
https://lists.isocpp.org/mailman/listinfo.cgi/std-proposals
------------------------------
End of Std-Proposals Digest, Vol 52, Issue 80
*********************************************