std::meta::is_const_type - cppreference.com
Namespaces
Variants

std::meta::is_const_type

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

Returns true if r represents a const-qualified type. Otherwise returns false.

Parameters

r - a reflection value

Return value

true if r represents a const-qualified type; otherwise false.

Exceptions

Throws std::meta::exception if r does not represent a type or type alias.

Example

#include <meta>

static_assert
(""
    && is_const_type(^^const int)
    && !is_const_type(^^int)
    && is_const_type(^^volatile const int)
    && !is_const_type(^^int*)
    && is_const_type(^^int* const)
    && !is_const_type(^^int const*)
);

int main() {}

See also