Espaces de noms
Variantes
Actions

std::is_bind_expression

De cppreference.com
< cpp‎ | utility‎ | functional

 
 
 
Objets Function
Emballages de fonction
Original:
Function wrappers
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
function (C++11)
mem_fn (C++11)
bad_function_call (C++11)
Lier
Original:
Bind
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
bind (C++11)
is_bind_expression (C++11)
is_placeholder (C++11)
_1, _2, _3, ... (C++11)
Emballages de référence
Original:
Reference wrappers
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
reference_wrapper (C++11)
ref
cref
(C++11)
(C++11)
Emballages opérateur
Original:
Operator wrappers
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Négateurs
Original:
Negators
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Obsolète liants et des adaptateurs
Original:
Deprecated binders and adaptors
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
unary_function (obsolète)
binary_function (obsolète)
ptr_fun (obsolète)
pointer_to_unary_function (obsolète)
pointer_to_binary_function (obsolète)
mem_fun (obsolète)
mem_fun_t
mem_fun1_t
const_mem_fun_t
const_mem_fun1_t
(obsolète)
(obsolète)
(obsolète)
(obsolète)
mem_fun_ref (obsolète)
mem_fun_ref_t
mem_fun1_ref_t
const_mem_fun_ref_t
const_mem_fun1_ref_t
(obsolète)
(obsolète)
(obsolète)
(obsolète)
binder1st
binder2nd
(obsolète)
(obsolète)
bind1st
bind2nd
(obsolète)
(obsolète)
 
Déclaré dans l'en-tête <functional>
template<class T >
struct is_bind_expression;
(depuis C++11)
Si T est le type généré par un appel à std::bind, ce modèle fournit un membre de valeur value constante égale à true. Pour tout autre type, value est false .
Original:
If T is the type produced by a call to std::bind, this template provides the member constant value equal true. For any other type, value is false.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Ce modèle peut être spécialisé pour un type défini par l'utilisateur qui doit être traitée par std::bind comme si elle était le type d'une sous-expression bind: si un objet fonction bind généré est invoquée, un argument lié de ce type sera appelée comme une fonction objet et sera donné tous les arguments non liés passées à l'objet bind généré .
Original:
This template may be specialized for a user-defined type which should be treated by std::bind as if it was the type of a bind subexpression: when a bind-generated function object is invoked, a bound argument of this type will be invoked as a function object and will be given all the unbound arguments passed to the bind-generated object.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

Sommaire

Inherited from std::integral_constant

Member constants

value
[
statique
Original:
static
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
]
true si T is a function object generated by std::bind, false autrement
Original:
true if T is a function object generated by std::bind, false otherwise
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(constante membre statique publique)

Member functions

operator bool
convertit l'objet en bool, retourne value
Original:
converts the object to bool, returns value
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(fonction membre publique)

Member types

Type d'
Original:
Type
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Definition
value_typebool
typestd::integral_constant<bool, value>

[modifier]Exemple

#include <iostream>#include <type_traits>#include <functional>   struct MyBind {typedefint result_type;int operator()(int a, int b)const{return a + b;}};   namespace std {template<>struct is_bind_expression<MyBind>:public true_type {};}   int f(int n1, int n2){return n1+n2;}   int main(){// as if bind(f, bind(MyBind::operator(), _1, _2), 2)auto b =std::bind(f, MyBind(), 2);   std::cout<<"Adding 2 to the sum of 10 and 11 gives "<< b(10, 11)<<'\n';}

Résultat :

Adding 2 to the sum of 10 and 11 gives 23

[modifier]Voir aussi

(C++11)
liaison de paramètres et application partielle d'un foncteur
(fonction générique)[edit]
close