foo - , , , . [over.built]/12
L R
LR operator*(L, R);
LR operator/(L, R);
LR operator+(L, R);
LR operator-(L, R);
bool operator<(L, R);
bool operator>(L, R);
bool operator<=(L, R);
bool operator>=(L, R);
bool operator==(L, R);
bool operator!=(L, R);
LR L R.
" ": bool.
A bool int, . [conv.prom]/6 ( )
bool prvalue int, false , true .
,
common_type<L,int> operator==(L, int);
L . ,
common_type<int , int> operator==(int , int);
common_type<long , int> operator==(long , int);
common_type<long long, int> operator==(long long, int);
foo . , , foo . CWG 954.
, g++ 4.8.1 clang++ 3.5 . ( , clang , . , g++ 4.8.1.)
common_type<bool, int> operator==(bool, int);
as bool . foo bool
foo x;
x == true