std::meta::remove_reference
Defined in header <meta> | ||
|---|---|---|
consteval std::meta::info remove_reference( std::meta::info r ); | (since C++26) |
If r represents a reference 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 reference removed, if r represents a reference type. Otherwise, r.
Exceptions
Throws std::meta::exception if r does not represent a type or type alias.
Example
#include <meta>
static_assert
(""
&& (remove_reference(^^int) == ^^int)
&& (remove_reference(^^int&) == ^^int)
&& (remove_reference(^^int&&) == ^^int)
&& (remove_reference(^^const int&) == ^^const int)
);
int main() {}
See also
|
(C++26) | checks if reflection represents either an lvalue reference or rvalue reference (function) |
|
(C++26)(C++26) | adds an lvalue or rvalue reference to reflected type (function) |
|
(C++26) | combines meta::remove_cv and meta::remove_reference (function) |
|
(C++11) | removes a reference 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_reference