cppreference.com
Create account
Log in
Namespaces
Page
Discussion
Variants
Views
View
Edit
History
Actions
std::reference_wrapper<T>::
operator=
From cppreference.com
<
cpp
|
utility
|
functional
|
reference wrapper
C++
Compiler support
Freestanding and hosted
Language
Standard library
Standard library headers
Named requirements
Feature test macros
(C++20)
Language support library
Concepts library
(C++20)
Metaprogramming library
(C++11)
Diagnostics library
General utilities library
Strings library
Containers library
Iterators library
Ranges library
(C++20)
Algorithms library
Numerics library
Localizations library
Input/output library
Filesystem library
(C++17)
Regular expressions library
(C++11)
Concurrency support library
(C++11)
Execution support library
(C++26)
Technical specifications
Symbols index
External libraries
[edit]
Utilities library
Language support
Type support
(basic types, RTTI)
Library feature-test macros
(C++20)
Dynamic memory management
Program utilities
Coroutine support
(C++20)
Variadic functions
is_constant_evaluated
(C++20)
is_within_lifetime
(C++26)
initializer_list
(C++11)
source_location
(C++20)
Three-way comparison
three_way_comparable
three_way_comparable_with
(C++20)
(C++20)
strong_ordering
(C++20)
weak_ordering
(C++20)
partial_ordering
(C++20)
common_comparison_category
(C++20)
compare_three_way_result
(C++20)
compare_three_way
(C++20)
strong_order
(C++20)
weak_order
(C++20)
partial_order
(C++20)
compare_strong_order_fallback
(C++20)
compare_weak_order_fallback
(C++20)
compare_partial_order_fallback
(C++20)
is_eq
is_lt
is_lteq
(C++20)
(C++20)
(C++20)
is_neq
is_gt
is_gteq
(C++20)
(C++20)
(C++20)
General utilities
Date and time
Function objects
Formatting library
(C++20)
bitset
hash
(C++11)
Relational operators
(deprecated in C++20)
rel_ops::operator!=
rel_ops::operator>
rel_ops::operator<=
rel_ops::operator>=
Integer comparison functions
cmp_equal
cmp_less
cmp_less_than
(C++20)
(C++20)
(C++20)
cmp_not_equal
cmp_greater
cmp_greater_than
(C++20)
(C++20)
(C++20)
in_range
(C++20)
Swap
and
type operations
swap
ranges::swap
(C++20)
exchange
(C++14)
declval
(C++11)
to_underlying
(C++23)
forward
(C++11)
forward_like
(C++23)
move
(C++11)
move_if_noexcept
(C++11)
as_const
(C++17)
Common vocabulary types
pair
tuple
(C++11)
optional
(C++17)
any
(C++17)
variant
(C++17)
tuple_size
(C++11)
tuple_element
(C++11)
apply
(C++17)
make_from_tuple
(C++17)
expected
(C++23)
Elementary string conversions
to_chars
(C++17)
from_chars
(C++17)
chars_format
(C++17)
to_chars_result
(C++17)
from_chars_result
(C++17)
[edit]
Function objects
Function wrappers
function
(C++11)
move_only_function
(C++23)
copyable_function
(C++26)
function_ref
(C++26)
mem_fn
(C++11)
bad_function_call
(C++11)
Partial function application
bind_front
bind_back
(C++20)
(C++23)
bind
(C++11)
is_bind_expression
(C++11)
is_placeholder
(C++11)
_1, _2, _3, ...
(C++11)
Function invocation
invoke
invoke_r
(C++17)
(C++23)
Identity function object
identity
(C++20)
Reference wrappers
reference_wrapper
(C++11)
ref
cref
(C++11)
(C++11)
unwrap_reference
unwrap_ref_decay
(C++20)
(C++20)
Operator wrappers
plus
minus
negate
multiplies
divides
modulus
bit_and
bit_or
bit_not
(C++14)
bit_xor
equal_to
not_equal_to
greater
less
greater_equal
less_equal
logical_and
logical_or
logical_not
Transparent operator wrappers
plus
<>
(C++14)
minus
<>
(C++14)
negate
<>
(C++14)
multiplies
<>
(C++14)
divides
<>
(C++14)
modulus
<>
(C++14)
bit_and
<>
(C++14)
bit_or
<>
(C++14)
bit_not
<>
(C++14)
bit_xor
<>
(C++14)
equal_to
<>
(C++14)
not_equal_to
<>
(C++14)
greater
<>
(C++14)
less
<>
(C++14)
greater_equal
<>
(C++14)
less_equal
<>
(C++14)
logical_and
<>
(C++14)
logical_or
<>
(C++14)
logical_not
<>
(C++14)
Negators
not_fn
(C++17)
Searchers
default_searcher
(C++17)
boyer_moore_searcher
(C++17)
boyer_moore_horspool_searcher
(C++17)
Constrained comparators
ranges::equal_to
(C++20)
ranges::not_equal_to
(C++20)
ranges::greater
(C++20)
ranges::less
(C++20)
ranges::greater_equal
(C++20)
ranges::less_equal
(C++20)
compare_three_way
(C++20)
Old binders and adaptors
unary_function
(
until C++17*
)
binary_function
(
until C++17*
)
ptr_fun
(
until C++17*
)
pointer_to_unary_function
(
until C++17*
)
pointer_to_binary_function
(
until C++17*
)
mem_fun
(
until C++17*
)
mem_fun_t
mem_fun1_t
const_mem_fun_t
const_mem_fun1_t
(
until C++17*
)
(
until C++17*
)
(
until C++17*
)
(
until C++17*
)
not1
(
until C++20*
)
not2
(
until C++20*
)
binder1st
binder2nd
(
until C++17*
)
(
until C++17*
)
bind1st
bind2nd
(
until C++17*
)
(
until C++17*
)
mem_fun_ref
(
until C++17*
)
mem_fun_ref_t
mem_fun1_ref_t
const_mem_fun_ref_t
const_mem_fun1_ref_t
(
until C++17*
)
(
until C++17*
)
(
until C++17*
)
(
until C++17*
)
unary_negate
(
until C++20*
)
binary_negate
(
until C++20*
)
[edit]
std::reference_wrapper
Member functions
reference_wrapper::reference_wrapper
reference_wrapper::operator=
reference_wrapper::get
reference_wrapper::operator T&
reference_wrapper::operator()
Non-member functions
operator==
operator<=>
(C++26)
(C++26)
Deduction guides
(C++17)
Helper classes
basic_common_reference
<std::reference_wrapper>
(C++23)
[edit]
reference_wrapper
&
operator
=
(
const
reference_wrapper
&
other
)
noexcept
;
(since C++11)
(constexpr since C++20)
Copy assignment operator. Drops the current reference and stores a reference to
other.
get
(
)
.
[
edit
]
Parameters
other
-
reference wrapper to copy
[
edit
]
Return value
*
this