Namespaces
Variants

std::meta::remove_reference

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_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

checks if reflection represents either an lvalue reference or rvalue reference
(function) [edit]
adds an lvalue or rvalue reference to reflected type
(function) [edit]
combines meta::remove_cv and meta::remove_reference
(function) [edit]
removes a reference from the given type
(class template) [edit]