std::function_ref:: operator=
From cppreference.net
<
cpp
|
utility
|
functional
|
function ref
C++
Utilities library
|
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Function objects
|
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Old binders and adaptors | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
std::function_ref
| Member functions | ||||
|
function_ref::operator=
|
||||
| Deduction guides |
|
constexpr
function_ref
&
operator
=
(
const
function_ref
&
)
noexcept
=
default
;
|
(1) | (C++26부터) |
|
template
<
class
T
>
constexpr function_ref & operator = ( T ) = delete ; |
(2) | (C++26부터) |
1)
복사 할당 연산자가 명시적으로 기본값으로 설정됩니다.
std::function_ref
는
copyable
와
TriviallyCopyable
를 만족합니다. 이 기본값 할당 연산자는 저장된
thunk-ptr
와
bound-entity
의 얕은 복사를 수행합니다.
2)
사용자 정의 할당 연산자는
T
가
std::function_ref
와 동일한 타입이 아니고,
std::
is_pointer_v
<
T
>
가
false
이며,
T
가
std::nontype_t
의 특수화가 아닌 경우 명시적으로 삭제됩니다. 이 오버로드는 위 조건에서 제약 조건이 충족되는 경우에만 오버로드 해결에 참여합니다.
반환값
* this
참고 항목
새로운
function_ref
객체를 생성함
(public member function) |
|
|
대상을 교체하거나 파괴함
(
std::copyable_function
의 public member function)
|
|
|
새로운 대상을 할당함
(
std::function<R(Args...)>
의 public member function)
|
|
|
대상을 교체하거나 파괴함
(
std::move_only_function
의 public member function)
|