STD::REFERENCE_WRAPPER(3cxx)
π NAME
std::reference_wrapper< _Tp > β the primary class template for reference_wrapper, bestie. That's the whole vibe, no notes π
β¨ SYNOPSIS
#include <functional>
πΈ Public Types
typedef _Tp typeβ the type it's wrapping, lowkey the whole point of the class π«Ά
π Public Member Functions
- the templated converting constructor β it's
constexpr, and it's got a wholenoexceptsituation going on:
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β the copy constructor, defaulted, does exactly what it says on the tin β¨constexpr _Tp & get () const noexceptβ grabs you the reference back,constexprandnoexcept, iconic behaviour πconstexpr operator _Tp & () const noexceptβ implicit conversion operator to_Tp &, same energy,constexpr,noexceptπ- the call operator
operator()β forwards to whatever_Tp &is, with all the_Args...:
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β copy assignment, defaulted, moving right along π¦
β Related Symbols
bestie read this part carefully: these are not member symbols. They live outside the class, they're just hanging out with it. Important distinction, no cap.
template<typename _Tp > constexpr reference_wrapper< _Tp > ref (_Tp &__t) noexceptβ denotes a reference should be taken to a variable πtemplate<typename _Tp > constexpr reference_wrapper< const _Tp > cref (const _Tp &__t) noexceptβ denotes a const reference should be taken to a variable πtemplate<typename _Tp > constexpr reference_wrapper< _Tp > ref (reference_wrapper< _Tp > __t) noexceptβ thestd::refoverload to prevent wrapping areference_wrapperπ (yes, so you can't wrap a wrapper, it's giving recursion protection)template<typename _Tp > constexpr reference_wrapper< const _Tp > cref (reference_wrapper< _Tp > __t) noexceptβ thestd::crefoverload to prevent wrapping areference_wrapperπ
πΌ Detailed Description
template<typename _Tp>
class std::reference_wrapper< _Tp >
Primary class template for reference_wrapper. Short, sweet, load-bearing. Periodt. π
π Friends And Related Symbol Documentation
template<typename _Tp > constexpr reference_wrapper< const _Tp > cref (const _Tp & __t) [related]β denotes a const reference should be taken to a variable πΈtemplate<typename _Tp > constexpr reference_wrapper< const _Tp > cref (reference_wrapper< _Tp > __t) [related]βstd::crefoverload to prevent wrapping areference_wrapperπ§template<typename _Tp > constexpr reference_wrapper< _Tp > ref (_Tp & __t) [related]β denotes a reference should be taken to a variable π₯template<typename _Tp > constexpr reference_wrapper< _Tp > ref (reference_wrapper< _Tp > __t) [related]βstd::refoverload to prevent wrapping areference_wrapperβ
π Author
Generated automatically by Doxygen for libstdc++ from the source code. Not me, not you, a robot did this. Slay, robot π«Ά
okay that's the whole page bestie, mwah π β this was libstdc++'s std::reference_wrapper< _Tp >(3cxx) and the version line is right there in the footer, so go be a main character with it πππ¦
π¦ where this page comes from
- ubuntu noble: libstdc++-14-doc 14-20240412-0ubuntu1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms