Skip to content

Latest commit

 

History

History
83 lines (60 loc) · 1.66 KB

type-traits-typedefs.md

File metadata and controls

83 lines (60 loc) · 1.66 KB
description title ms.date f1_keywords ms.assetid
Learn more about: <type_traits> typedefs
<type_traits> typedefs
11/04/2016
type_traits/std::false_type
xtr1common/std::false_type
type_traits/std::true_type
xtr1common/std::true_type
8ac040ca-ed2d-4570-adc9-cb5626530053

<type_traits> typedefs

false_type
true_type

false_type Typedef

Holds integral constant with false value.

typedef integral_constant<bool, false> false_type;

Remarks

The type is a synonym for a specialization of the template integral_constant.

Example

#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

Holds integral constant with true value.

typedef integral_constant<bool, true> true_type;

Remarks

The type is a synonym for a specialization of the template integral_constant.

Example

// 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

See also

<type_traits>