It's not just chars that are ints.
Though bools are a different type than int, they can be used wherever an int is.
For instance, a template can take type arguments and int non-type arguments.
Eg:
1 2 3 4 5
|
template<typename T, int N>
void f()
{
/// ...
}
|
Here, you can instantiate the template with a bool in place of the N, since an implicit type conversion takes place.
Eg:
|
f<A, b>(); /// A is a class, b is a bool
|
Also, enums and enum classes are implemented, by default, as ints.
Therefore an enum value can be passed where an int is expected. However, an enum class can't since it isn't interchangeable with an int.
Finally a class can define a conversion operator to an int. If so, it can also be used where an int is expected.