Saturday, August 22, 2009

The safe Bool ideom

Operator overloading is considered a major C++ feature. But as so often with C++ this feature sometimes clashes with other language properties.

Roker pointed me to an article about the safe bool idiom where the author elaborates on why a simple operator bool is not satisfying if you want to be able to use an object within a bool context. Have fun...

No comments:

Post a Comment