[meta.reflection.names] (original) (raw)

21 Metaprogramming library [meta]

21.4.6 Reflection names and locations [meta.reflection.names]

consteval bool has_identifier(info r);

Returns:

consteval string_view identifier_of(info r);consteval u8string_view u8identifier_of(info r);

Let E be UTF-8 for u8identifier_of, and otherwise the ordinary literal encoding.

Returns: An ntmbs, encoded with E, determined as follows:

Throws: meta​::​exception unlesshas_identifier(r) is trueand the identifier that would be returned (see above) is representable by E.

consteval string_view display_string_of(info r);consteval u8string_view u8display_string_of(info r);

Returns: Animplementation-definedstring_view or u8string_view, respectively.

Recommended practice: Where possible, implementations should return a string suitable for identifying the represented construct.

consteval source_location source_location_of(info r);

Returns: If r represents a value, a type other than a class type or an enumeration type, the global namespace, or a data member description, then source_location{}.

Otherwise, animplementation-definedsource_location value.

Recommended practice: If r represents an entity with a definition that is reachable from the evaluation context, a value corresponding to a definition should be returned.