25% of programmers work time is spended by checking if the required code already exist.
I'm searching for a base class for implementing the safe bool idiom.
25% of programmers work time is spended by checking if the required code already exist.
I'm searching for a base class for implementing the safe bool idiom.
bool_testable<>
in Boost.Operators looks promising.The reference mentions that:
The safest thing to do is to not have implicit conversion to
bool
.Make that conversion explicit.
Then the name, if chosen well, can also help people understand what it's all about.
Cheers & hth.,