Namespaces
Variants

std::meta::is_public, std::meta::is_protected, std::meta::is_private

From cppreference.com
< cpp | meta
 
 
 
Reflection library
 
Reflection types and queries
Type properties
Type property queries
 
Defined in header <meta>
consteval bool is_public( std::meta::info r );
(1) (since C++26)
consteval bool is_protected( std::meta::info r );
(2) (since C++26)
consteval bool is_private( std::meta::info r );
(3) (since C++26)

Determines if r represents a class member or direct base class relationship with the specified access.

Formally, returns true if r represents either:

  • a class member or unnamed bit-field that is public, protected, or private, respectively, or
  • a direct base class relationship (D, B) for which B is, respectively, a public, protected, or private base class of D.

Otherwise, returns false.

Parameters

r - a reflection value

Return value

true if r represents a member or direct base class relationship with the given access, otherwise false

Example

See also

checks if a member is accessible in a given context
(function) [edit]