libstdc++: std::reference_wrapper< _Tp > Class Template Reference

libstdc++

std::reference_wrapper< _Tp > Class Template Reference
Utilities » Function Objects

`#include <refwrap.h>`

## Public Types
typedef _Tp | type

## Public Member Functions
template<typename _Up, typename = __not_same<_Up>, typename = decltype(reference_wrapper::_S_fun(std::declval<_Up>()))>
constexpr | reference_wrapper (_Up &&__uref) noexcept(noexcept(reference_wrapper::_S_fun(std::declval< _Up >())))
| reference_wrapper (const reference_wrapper &)=default
constexpr _Tp & | get () const noexcept
constexpr | operator _Tp & () const noexcept
template<typename... _Args>
constexpr __invoke_result< _Tp &, _Args... >::type | operator() (_Args &&... __args) const noexcept(__is_nothrow_invocable< _Tp &, _Args... >::value)
reference_wrapper & | operator= (const reference_wrapper &)=default

## Friends
constexpr auto | operator<=> (reference_wrapper __x, const _Tp &__y)
constexpr auto | operator<=> (reference_wrapper __x, reference_wrapper __y)
constexpr auto | operator<=> (reference_wrapper __x, reference_wrapper< const _Tp > __y)
constexpr bool | operator== (reference_wrapper __x, const _Tp &__y)
constexpr bool | operator== (reference_wrapper __x, reference_wrapper __y)
constexpr bool | operator== (reference_wrapper __x, reference_wrapper< const _Tp > __y)

## Related Symbols
(Note that these are not member symbols.)
template<typename _Tp>
constexpr reference_wrapper< _Tp > | ref (_Tp &__t) noexcept
template<typename _Tp>
constexpr reference_wrapper< const _Tp > | cref (const _Tp &__t) noexcept
template<typename _Tp>
constexpr reference_wrapper< _Tp > | ref (reference_wrapper< _Tp > __t) noexcept
template<typename _Tp>
constexpr reference_wrapper< const _Tp > | cref (reference_wrapper< _Tp > __t) noexcept

## Detailed Description

template<typename _Tp>
class std::reference_wrapper< _Tp >

Primary class template for reference_wrapper.

Definition at line 310 of file refwrap.h.

## Member Typedef Documentation

## ◆ type

template<typename _Tp>

typedef _Tp std::reference_wrapper< _Tp >::type

Definition at line 328 of file refwrap.h.

## Constructor & Destructor Documentation

## ◆ reference_wrapper()

template<typename _Tp>
template<typename _Up, typename = __not_same<_Up>, typename = decltype(reference_wrapper::_S_fun(std::declval<_Up>()))>

std::reference_wrapper< _Tp >::reference_wrapper | ( | _Up && | __uref | ) |
| inlineconstexprnoexcept

Definition at line 336 of file refwrap.h.

## Member Function Documentation

## ◆ get()

template<typename _Tp>

_Tp & std::reference_wrapper< _Tp >::get | ( |  | ) | const
| inlineconstexprnoexcept

Definition at line 352 of file refwrap.h.

## ◆ operator _Tp &()

template<typename _Tp>

std::reference_wrapper< _Tp >::operator _Tp & | ( |  | ) | const
| inlineconstexprnoexcept

Definition at line 347 of file refwrap.h.

## ◆ operator()()

template<typename _Tp>
template<typename... _Args>

__invoke_result< _Tp &, _Args... >::type std::reference_wrapper< _Tp >::operator() | ( | _Args &&... | __args | ) | const
| inlineconstexprnoexcept

Definition at line 358 of file refwrap.h.

## Friends And Related Symbol Documentation

## ◆ cref() [1/2]

template<typename _Tp>

reference_wrapper< const _Tp > cref | ( | const _Tp & | __t | ) |
| related

Denotes a const reference should be taken to a variable.

Definition at line 435 of file refwrap.h.

## ◆ cref() [2/2]

template<typename _Tp>

reference_wrapper< const _Tp > cref | ( | reference_wrapper< _Tp > | __t | ) |
| related

std::cref overload to prevent wrapping a reference_wrapper

Definition at line 455 of file refwrap.h.

## ◆ operator<=> [1/3]

template<typename _Tp>

auto operator<=> | ( | reference_wrapper< _Tp > | __x,
|  | const _Tp & | __y )
| friend

Definition at line 401 of file refwrap.h.

## ◆ operator<=> [2/3]

template<typename _Tp>

auto operator<=> | ( | reference_wrapper< _Tp > | __x,
|  | reference_wrapper< _Tp > | __y )
| friend

Definition at line 393 of file refwrap.h.

## ◆ operator<=> [3/3]

template<typename _Tp>

auto operator<=> | ( | reference_wrapper< _Tp > | __x,
|  | reference_wrapper< const _Tp > | __y )
| friend

Definition at line 407 of file refwrap.h.

## ◆ operator== [1/3]

template<typename _Tp>

bool operator== | ( | reference_wrapper< _Tp > | __x,
|  | const _Tp & | __y )
| friend

Definition at line 378 of file refwrap.h.

## ◆ operator== [2/3]

template<typename _Tp>

bool operator== | ( | reference_wrapper< _Tp > | __x,
|  | reference_wrapper< _Tp > | __y )
| friend

Definition at line 372 of file refwrap.h.

## ◆ operator== [3/3]

template<typename _Tp>

bool operator== | ( | reference_wrapper< _Tp > | __x,
|  | reference_wrapper< const _Tp > | __y )
| friend

Definition at line 384 of file refwrap.h.

## ◆ ref() [1/2]

template<typename _Tp>

reference_wrapper< _Tp > ref | ( | _Tp & | __t | ) |
| related

Denotes a reference should be taken to a variable.

Definition at line 428 of file refwrap.h.

## ◆ ref() [2/2]

template<typename _Tp>

reference_wrapper< _Tp > ref | ( | reference_wrapper< _Tp > | __t | ) |
| related

std::ref overload to prevent wrapping a reference_wrapper

Definition at line 448 of file refwrap.h.

The documentation for this class was generated from the following files:

- type_traits
- refwrap.h