Boolean literals

1 Syntax

# Notes

See Integral conversions for implicit conversions from bool to other types and boolean conversions for the implicit conversions from other types to bool.

# Example

#include <iostream>
 
int main()
{
    std::cout << std::boolalpha
              << true << '\n'
              << false << '\n'
              << std::noboolalpha
              << true << '\n'
              << false << '\n';
}

# See also