|  | Home | Libraries | People | FAQ | More | 
template <class T>
struct is_function : public true_type-or-false_type {};
Inherits: If T is a (possibly cv-qualified) function type then inherits from true_type, otherwise inherits from false_type. Note that this template does not detect pointers to functions, or references to functions, these are detected by is_pointer and is_reference respectively:
typedef int f1(); // f1 is of function type. typedef int (*f2)(); // f2 is a pointer to a function. typedef int (&f3)(); // f3 is a reference to a function.
C++ Standard Reference: 3.9.2p1 and 8.3.5.
Compiler Compatibility: All current compilers are supported by this trait.
        Header:  #include
        <boost/type_traits/is_function.hpp>
        or  #include <boost/type_traits.hpp>
      
Examples:
is_function<int (void)>inherits fromtrue_type.
is_function<long (double, int)>::typeis the typetrue_type.
is_function<long (double, int)>::valueis an integral constant expression that evaluates to true.
is_function<long (*)(double, int)>::valueis an integral constant expression that evaluates to false: the argument in this case is a pointer type, not a function type.
is_function<long (&)(double, int)>::valueis an integral constant expression that evaluates to false: the argument in this case is a reference to a function, not a function type.
is_function<long (MyClass::*)(double, int)>::valueis an integral constant expression that evaluates to false: the argument in this case is a pointer to a member function.
is_function<T>::value_typeis the typebool.
| ![[Tip]](../../../../../../doc/src/images/tip.png) | Tip | 
|---|---|
| Don't confuse function-types with pointers to functions: 
           defines a function type, 
           
          declares a prototype for a function of type  
           
           
          declares a pointer and a reference to the function  If you want to detect whether some type is a pointer-to-function then use: 
           or for pointers to member functions you can just use is_member_function_pointer directly. |