If I define an enum like so:
enum Foo : bool { Left = false, Right = true };
then try to construct one from a boolean like so:
int main (int ac, const char **av) {
Foo foo ( ac > 1 );
cout << boolalpha << bool(foo) << endl;
return 0;
}
it fails, but works with an extra constructor like so:
Foo foo ( Foo( ac > 1 ) );
Why is this? I thought Foo foo (...)
was an explicit constructor call?