class template
<functional>

std::is_bind_expression

template <class T> struct is_bind_expression;
Is bind expression

Trait class that identifies whether T is a bind expression.

It inherits from integral_constant as being either true_type or false_type, depending on whether T is a type returned from bind or not.

The bind function uses this trait to determine whether the type of each of its arguments is a subexpression (i.e., whether it is itself a type returned by bind). Users are allowed to specialize this template for types that are to be treated as bind subexpressions.

Template parameters

T
A type.

Member types

Inherited from integral_constant:
member typedefinition
value_typebool
typeeither true_type or false_type

Member constants

Inherited from integral_constant:
member constantdefinition
valueeither true or false

Member functions

Inherited from integral_constant:

Example

1
2
3
4
5
6
7
8
9
10
11
12
13
// is_bind_expression example
#include <iostream>     // std::cout, std::boolalpha
#include <functional>   // std::bind, std::plus, std::placeholders, std::is_bind_expression

int main () {
  using namespace std::placeholders;  // introduces _1
  auto increase_int = std::bind (std::plus<int>(),_1,1);

  std::cout << std::boolalpha;
  std::cout << std::is_bind_expression<decltype(increase_int)>::value << '\n';

  return 0;
}


Output:
true

See also