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 ) ;
(depuis C++11)
(supprimé dans C++17)

Initialise la cible avec f . Le alloc est utilisé pour allouer de la mémoire pour toute structure de données interne que la function pourrait utiliser.

Équivalent à function ( std:: allocator_arg , alloc, std:: forward < F > ( f ) ) . swap ( * this ) ; .

Table des matières

Paramètres

f - fonction appelable pour initialiser la cible avec
alloc - allocateur à utiliser pour allouer la mémoire pour les structures de données internes

Valeur de retour

(aucun)

Exceptions

Peut lever des exceptions définies par l'implémentation.

Voir aussi

assigne une nouvelle cible
(fonction membre publique)