<type_traits>
typedef
false_type Typedef
保留包含值 false 的整数常量。
typedef integral_constant<bool, false> false_type;
备注
该类型是模板 integral_constant
的专用化的同义词。
示例
#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);
}
false_type == false
true_type == true
true_type Typedef
保留包含值 true 的整数常量。
typedef integral_constant<bool, true> true_type;
注解
该类型是模板 integral_constant
的专用化的同义词。
示例
// std__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);
}
false_type == false
true_type == true
另请参阅
反馈
https://aka.ms/ContentUserFeedback。
即将发布:在整个 2024 年,我们将逐步淘汰作为内容反馈机制的“GitHub 问题”,并将其取代为新的反馈系统。 有关详细信息,请参阅:提交和查看相关反馈