36#define DEBUGOUT( s ) \
38 std::ostringstream os_; \
39 os_ << " DEBUG: " << s; \
40 OutputDebugStringA( os_.str().c_str() ); \
45extern std::ostream*
logger;
50#define LOG(x) ((x) ? (*logger) : (*nulllogger))
57 #if defined(_WIN32) && defined(_UNICODE)
70 T mask = (-1 << numBits);
71 if ((value & mask) != 0) {
72 throw std::invalid_argument(
"Invalid value with too many bits set.");
77#define CALL_MEMBER_FN(object,ptrToMember) ((object).*(ptrToMember))
82 bool _trace(
TCHAR *format, ...);
86 #define TRACE false && _trace
std::ostream * nulllogger
std::wstring toWString(const std::string &s)
std::string toString(const std::wstring &ws)
T CheckBits(T value, unsigned int numBits)
std::ostream * SetLogger(std::ostream *logger_)