In C++03, you need to use safe bool idiom to avoid evil things, like
int x = my_object; // this works
In C++11, use explicit conversion.
explicit operator bool() const;
'programming > C++' 카테고리의 다른 글
Compare tuples? (0) | 2013.02.20 |
---|---|
Online C++ compilers (0) | 2013.02.18 |
std::atomic (0) | 2013.02.18 |
C++11 cheat sheet (0) | 2013.02.18 |
Universal reference (0) | 2013.02.18 |