std::meta::is_lvalue_reference_type
From cppreference.com
| Defined in header <meta>
|
||
consteval bool is_lvalue_reference_type( std::meta::info r );
|
(since C++26) | |
Returns true if r represents an lvalue reference. Otherwise returns false.
Parameters
| r | - | a reflection value |
Return value
true if r represents an lvalue reference; otherwise false.
Exceptions
Throws std::meta::exception if r does not represent a type or type alias.
Example
Run this code
#include <meta>
static_assert(is_lvalue_reference_type(^^int) == false);
static_assert(is_lvalue_reference_type(^^int&) == true);
static_assert(is_lvalue_reference_type(^^int&&) == false);
static_assert(is_rvalue_reference_type(^^int&&) == true);
class A {};
static_assert(is_lvalue_reference_type(^^A) == false);
static_assert(is_lvalue_reference_type(^^A&) == true);
static_assert(is_lvalue_reference_type(^^A&&) == false);
static_assert(is_rvalue_reference_type(^^A&&) == true);
int main() {}
See also
(C++26) |
checks if reflection represents an rvalue reference (function) |
(C++26) |
checks if reflection represents either an lvalue reference or rvalue reference (function) |
(C++11) |
checks if a type is an lvalue reference (class template) |