Namespaces
Variants

std::meta::is_lvalue_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_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

#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

checks if reflection represents an rvalue reference
(function) [edit]
checks if reflection represents either an lvalue reference or rvalue reference
(function) [edit]
checks if a type is an lvalue reference
(class template) [edit]
Morty Proxy This is a proxified and sanitized view of the page, visit original site.