Sdílet prostřednictvím


is_function – třída

Zkoušky, pokud typ je typ funkce.

template<class Ty>
    struct is_function;

Parametry

  • Ty
    Typ dotazu.

Poznámky

Instance typu predikát obsahuje true Pokud typ Ty je funkce typ, jinak má hodnotu false.

Příklad

 

// std_tr1__type_traits__is_function.cpp 
// compile with: /EHsc 
#include <type_traits> 
#include <iostream> 
 
struct trivial 
    { 
    int val; 
    }; 
 
struct functional 
    { 
    int f(); 
    }; 
 
int main() 
    { 
    std::cout << "is_function<trivial> == " << std::boolalpha 
        << std::is_function<trivial>::value << std::endl; 
    std::cout << "is_function<functional> == " << std::boolalpha 
        << std::is_function<functional>::value << std::endl; 
    std::cout << "is_function<float()> == " << std::boolalpha 
        << std::is_function<float()>::value << std::endl; 
 
    return (0); 
    } 
 
  

Požadavky

Záhlaví: <type_traits>

Obor názvů: std

Viz také

Referenční dokumentace

<type_traits>

is_object – třída

Další zdroje

<type_traits> Členové