Namespaces
Variants

std::meta::has_parent

From cppreference.com
< cpp | meta
Defined in header <meta>
consteval bool has_parent( std::meta::info r );
(since C++26)

Determines whether r represents an entity with a parent.

The result is determined as follows:

  • If r represents the global namespace, returns false.
  • Otherwise, if r represents an entity that has "C" language linkage, returns false.
  • Otherwise, if r represents an entity that has a language linkage other than "C++" language linkage, returns an implementation-defined value.
  • Otherwise, if r represents a type that is neither class nor enumeration type, returns false.
  • Otherwise, if r represents an entity or direct base class relationship, returns true.
  • Otherwise, returns false.

Parameters

r - a reflection value

Return value

true if r has a parent, false otherwise.

Example

See also

(C++26)
obtains the scope that contains the reflected entity
(function) [edit]