std::meta::remove_pointer
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
|
(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) |
© cppreference.com
Licensed under the Creative Commons Attribution-ShareAlike Unported License v3.0.
https://en.cppreference.com/cpp/meta/remove_pointer