Spec-Zone.ru › C++

std::meta::has_parent

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

parent_of
(C++26)
obtains the scope that contains the reflected entity
(function)

© cppreference.com
Licensed under the Creative Commons Attribution-ShareAlike Unported License v3.0.
https://en.cppreference.com/cpp/meta/has_parent

Spec-Zone.ru

Настройки Оффлайн Что нового Помощь О нас
Spec-Zone .ru
спецификации, руководства, описания, API