共用方式為


true_type Typedef

會保留整數常數,則為 true 的值。

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>

Namespace: 標準

請參閱

參考

<type_traits>

false_type Typedef

其他資源

<type_traits> 成員