Namespaces
Variants

std::meta::is_reference_type

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

Returns true if r represents either an lvalue reference or rvalue reference. Otherwise returns false.

Parameters

r - a reflection value

Return value

true if r represents either an lvalue reference or rvalue reference; otherwise false.

Exceptions

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

Example

#include <meta>

class A {};

static_assert
(""
    && is_reference_type(^^A) != true
    && is_reference_type(^^A&) == true
    && is_reference_type(^^A&&) == true
    && is_reference_type(^^long) != true
    && is_reference_type(^^long&) == true
    && is_reference_type(^^long&&) == true
    && is_reference_type(^^double*) != true
    && is_reference_type(^^double*&) == true
    && is_reference_type(^^double*&&) == true
);

int main() {}

See also

checks if reflection represents an lvalue reference
(function) [edit]
checks if reflection represents an rvalue reference
(function) [edit]
checks if a type is either an lvalue reference or rvalue reference
(class template) [edit]