std::meta::remove_pointer
From cppreference.com
| 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
Run this code
#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
(C++26) |
checks if reflected type is a pointer type (function) |
(C++26) |
adds a pointer to reflected type (function) |
(C++11) |
removes a pointer from the given type (class template) |