true_type Typedef

保存具有有效值的整数常数。

typedef integral_constant<bool, true> true_type;

备注

该类型是 integral_constant 模板的专用化的同义词。

示例

 

// std_tr1__type_traits__true_type.cpp 
// compile with: /EHsc 
#include <type_traits> 
#include <iostream> 
 
int main() 
    { 
    std::cout << "false_type == " << std::boolalpha 
        << std::false_type::value << std::endl; 
    std::cout << "true_type == " << std::boolalpha 
        << std::true_type::value << std::endl; 
 
    return (0); 
    } 
 
  

要求

标头: <type_traits>

命名空间: std

请参见

参考

<type_traits>

false_type Typedef

其他资源

type_traits 成员