Title
`is_enumerable_type`: Definition of "enumerable type" looks strange
Status
new
Section
[meta.reflection.queries]
Submitter
S. B. Tam

Created on 2026-05-18.00:00:00 last changed 1 week ago

Messages

Date: 2026-05-24.08:25:51

Proposed resolution:

This wording is relative to N5046.

  1. Modify [meta.reflection.queries] as indicated:

    consteval bool is_enumerable_type(info r);
    

    -30- A type T is enumerable from a point P if either

    1. (30.1) — T is a class type complete at point P or

    2. (30.2) — T is an enumeration type defined by a declaration an enum-specifier D ([dcl.enum]) such that D is reachable from P but P does not occur within an enum-specifier of D ([dcl.enum]).

Date: 2026-05-18.00:00:00

[meta.reflection.queries] p30 says:

-30- A type T is enumerable from a point P if either

  1. (30.1) — T is a class type complete at point P or

  2. (30.2) — T is an enumeration type defined by a declaration D such that D is reachable from P but P does not occur within an enum-specifier of D ([dcl.enum]).

The second bullet looks strange to a language lawyer: an enum type can only be declared by opaque-enum-declarations and enum-specifiers ([dcl.enum]), and only the latter are definitions ([basic.def] p2). That is, D must be an enum-specifier. What does it mean to say "an enum-specifier of an enum-specifier"?

I think, instead of saying "an enum-specifier of D", the second bullet could simply refer to D as an enum-specifier.

History
Date User Action Args
2026-05-24 08:25:51adminsetmessages: + msg16320
2026-05-18 00:00:00admincreate