Frederick said:
Kirit Sælensminde:
!!a
is short-hand for:
(bool)a
Because it's dressed up to look like you're passing an argument to a
constructor. Intrinisc types are distinct from user-defined types... don't
lump them into the same category and come out with bastardisations such as:
int i(1);
, it just looks stupid, plus it makes one have to consider the "if it looks
like a declaration" rule.
I'm not sure that I agree with you on that. The important distinction
between the types we use is whether they follow object or value
semantics, not whether they happen to be in the sub-set of types that
happen to be defined by keywords in the standard.
std::string s( "Hello" );
Presumably you consider the above OK? It invites equal consideration to
the "if it looks like a declaration" rule.
K