Consider the following excerpt from the safe bool idiom:
typedef void (Testable::*bool_type)() const;
operator bool_type() const;
Is it possibl
My analysis says that it is not possible without using typedef
. The compiler sees (
as the first token and assumes you are overloading () operator
, which shouldn't have any arguments (The arguments would come in next set of parenthesis). Putting any set of extra parenthesis wouldn't help either - but would actually confuse the compiler and hence set of more errors.
Most of the STL code is on top of typedef
initions, and we should/must use them!