blocxx
SafeBool.hpp File Reference
#include "blocxx/BLOCXX_config.h"

Go to the source code of this file.

Namespaces

namespace  BLOCXX_NAMESPACE
 Taken from RFC 1321.
 

Macros

#define BLOCXX_SAFE_BOOL_IMPL(classname, type, variable, test)
 

Macro Definition Documentation

◆ BLOCXX_SAFE_BOOL_IMPL

#define BLOCXX_SAFE_BOOL_IMPL ( classname,
type,
variable,
test )
Value:
typedef type classname::*safe_bool; \
operator safe_bool () const \
{ \
return (test) ? &variable : 0; \
} \
bool operator !() const \
{ \
return !(test); \
}

Definition at line 58 of file SafeBool.hpp.