Spec-Zone.ru › C++

std::meta::is_lvalue_reference_type

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

is_rvalue_reference_type
(C++26)
checks if reflection represents an rvalue reference
(function)
is_reference_type
(C++26)
checks if reflection represents either an lvalue reference or rvalue reference
(function)
is_lvalue_reference
(C++11)
checks if a type is an lvalue reference
(class template)

© cppreference.com
Licensed under the Creative Commons Attribution-ShareAlike Unported License v3.0.
https://en.cppreference.com/cpp/meta/is_lvalue_reference_type

Spec-Zone.ru

Настройки Оффлайн Что нового Помощь О нас
Spec-Zone .ru
спецификации, руководства, описания, API