Share via


typedef <type_traits>

false_type
true_type

false_type-Typedef

Enthält eine Ganzzahlkonstante mit einem falschen Wert.

typedef integral_constant<bool, false> false_type;

Hinweise

Der Typ ist ein Synonym für eine Spezialisierung der Vorlage integral_constant.

Beispiel

#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-Typdefinition

Enthält eine Ganzzahlkonstante mit einem wahren Wert.

typedef integral_constant<bool, true> true_type;

Hinweise

Der Typ ist ein Synonym für eine Spezialisierung der Vorlage integral_constant.

Beispiel

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

Siehe auch

<type_traits>