[Development] API style guide: scoped enum or not?

Giuseppe D'Angelo giuseppe.dangelo at kdab.com
Thu Jan 23 15:44:34 CET 2025


Hi,

On 16/01/2025 16:29, Marc Mutz wrote:
> On 16.01.25 15:05, Thiago Macieira wrote:
>> On Thursday 16 January 2025 04:55:56 Pacific Standard Time Marc Mutz via
>> Development wrote:
>>> https://gcc.godbolt.org/z/6exEonP5o, maybe?
>> Yes.
> @Ville, @Peppe: do you happen to know whether this is supposed to work
> (using enum T when T is a typename from the template-initializer), or
> whether there's a proposal to make it work?

It is actually explicitly forbidden. The proposal itself says

> https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1099r5.html#wording-changes

"The elaborated-enum-specifier shall not name a dependent type". That 
clause has been added deliberately, "why enum names must not be 
dependent types". But I can't seem to find the reasoning behind this...

-- 
Giuseppe D'Angelo | giuseppe.dangelo at kdab.com | Senior Software Engineer
KDAB (France) S.A.S., a KDAB Group company
Tel. France +33 (0)4 90 84 08 53, http://www.kdab.com
KDAB - Trusted Software Excellence

-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 4244 bytes
Desc: S/MIME Cryptographic Signature
URL: <http://lists.qt-project.org/pipermail/development/attachments/20250123/a65bf744/attachment.bin>


More information about the Development mailing list