N
Neelesh Bodas
Can somebody please explain the fine difference between these two
clauses of the standard:
4.5 (Integral promotions)
4. An rvalue of type bool can be converted to an rvalue of type
int, with false becoming zero and true becoming one
4.7 (Integral conversions)
4. If the source type is bool, the value false is converted to zero
and the value true is converted to one.
Thus, is bool-to-int an integral promotion or integral conversion?
void foo(const int&);
void bar(int);
bool b = false;
int i = false; // here?
foo(b); // here?
bar(b); //here?
-Neelesh
clauses of the standard:
4.5 (Integral promotions)
4. An rvalue of type bool can be converted to an rvalue of type
int, with false becoming zero and true becoming one
4.7 (Integral conversions)
4. If the source type is bool, the value false is converted to zero
and the value true is converted to one.
Thus, is bool-to-int an integral promotion or integral conversion?
void foo(const int&);
void bar(int);
bool b = false;
int i = false; // here?
foo(b); // here?
bar(b); //here?
-Neelesh