Namespaces
Variants

std::function<R(Args...)>:: assign

From cppreference.net
Utilities library
Function objects
Function invocation
(C++17) (C++23)
Identity function object
(C++20)
Old binders and adaptors
( until C++17* )
( until C++17* )
( until C++17* )
( until C++17* )
( until C++17* ) ( until C++17* ) ( until C++17* ) ( until C++17* )
( until C++20* )
( until C++20* )
( until C++17* ) ( until C++17* )
( until C++17* ) ( until C++17* )

( until C++17* )
( until C++17* ) ( until C++17* ) ( until C++17* ) ( until C++17* )
( until C++20* )
( until C++20* )
template < class F, class Alloc >
void assign ( F && f, const Alloc & alloc ) ;
(C++11부터)
(C++17에서 제거됨)

target f 로 초기화합니다. alloc function 이 사용할 수 있는 내부 데이터 구조를 위한 메모리를 할당하는 데 사용됩니다.

다음과 동일함 function ( std:: allocator_arg , alloc, std:: forward < F > ( f ) ) . swap ( * this ) ; .

목차

매개변수

f - target 을 초기화하기 위해 호출할 함수
alloc - 내부 데이터 구조에 대한 메모리를 할당하는 데 사용할 할당자

반환값

(없음)

예외

구현 정의 예외를 던질 수 있습니다.

참고 항목

새로운 대상을 할당
(public member function)