<type_traits>
typedefs
Holds integral constant with false value.
C++
typedef integral_constant<bool, false> false_type;
The type is a synonym for a specialization of the template integral_constant
.
C++
#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);
}
Output
false_type == false
true_type == true
Holds integral constant with true value.
C++
typedef integral_constant<bool, true> true_type;
The type is a synonym for a specialization of the template integral_constant
.
C++
// 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);
}
Output
false_type == false
true_type == true