std::meta::is_reference_type
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
|
(C++26) | checks if reflection represents an lvalue reference (function) |
|
(C++26) | checks if reflection represents an rvalue reference (function) |
|
(C++11) | checks if a type is either an lvalue reference or rvalue reference (class template) |
© cppreference.com
Licensed under the Creative Commons Attribution-ShareAlike Unported License v3.0.
https://en.cppreference.com/cpp/meta/is_reference_type