Consider the following excerpt from the safe bool idiom:
typedef void (Testable::*bool_type)() const;
operator bool_type() const;
Is it possibl
I just ran across this issue, with clang++:
foo.cpp:17:8: error: must use a typedef to declare a conversion to 'void (*(int))()'
and there's a C++11 STL template which covers the identity
#include
…
struct foo {
void bar( ) const { }
operator std::common_type::type( ) { return &foo::bar; }
};