Namespaces
Variants

std::meta::remove_pointer

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

If r represents a pointer type T, returns a reflection that represents the type referred to by T. Otherwise, returns r.

Parameters

r - a reflection value

Return value

A reflection of the underlying type T, with pointer removed, if r represents a pointer type. Otherwise, r.

Exceptions

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

Example

#include <meta>

static_assert
(
    (^^int == remove_pointer(^^int)) &&
    (^^int == remove_pointer(^^int*)) &&
    (^^int != remove_pointer(^^int**)) &&
    (^^int* == remove_pointer(^^int**)) &&
    (^^int == remove_pointer(^^int* const)) &&
    (^^int == remove_pointer(^^int* volatile)) &&
    (^^int == remove_pointer(^^int* const volatile))
);

int main() {}

See also

checks if reflected type is a pointer type
(function) [edit]
adds a pointer to reflected type
(function) [edit]
removes a pointer from the given type
(class template) [edit]