operator bool: Move operator bool handling to its own include file.
[gemrb.git] / gemrb / includes / operatorbool.h
blobc9fb188fc77449b1c43eca167be912c11a3151ac
1 #ifndef OPERATORBOOL_H
2 #define OPERATORBOOL_H
3 // Copied from boost/smart_ptr/detail/operator_bool.hpp
5 #ifndef _MSC_VER
6 #define OPERATOR_BOOL(Class,T,ptr) operator T* Class::*() const { return ptr == NULL ? NULL : &Class::ptr; }
7 #else // MSVC6
8 // FIXME: Figure out what version doesn't need this hack.
9 #define OPERATOR_BOOL(Class,T,ptr) operator bool() const { return ptr != NULL; }
10 #endif
12 #endif