#include <stlsoft/util/zero.hpp>
This class can act as a replacement for the ZERO macro, by being validly assigned to or equated with pointer types only, as in
int i = ZERO; // error int *p = ZERO; // OK
if(i == ZERO) {} // error if(ZERO == i) {} // error
if(p == ZERO) {} // OK if(ZERO == p) {} // OK
When used via inclusion of the file stlsoft_zerodef.h, the macro ZERO is redefined as ZERO_v(), such that expressions containing ZERO will be valid against pointers only.
Public Member Functions | |
ZERO_v () | |
Default constructor. | |
operator ss_sint8_t () const | |
A zero (of type ss_sint8_t). | |
operator ss_uint8_t () const | |
A zero (of type ss_uint8_t). | |
operator ss_sint16_t () const | |
A zero (of type ss_sint16_t). | |
operator ss_uint16_t () const | |
A zero (of type ss_uint16_t). | |
operator ss_sint32_t () const | |
A zero (of type ss_sint32_t). | |
operator ss_uint32_t () const | |
A zero (of type ss_uint32_t). | |
operator float () const | |
A zero (of type float). | |
operator double () const | |
A zero (of type double). | |
operator long double () const | |
A zero (of type long double). | |
Static Public Member Functions | |
static ZERO_v | create () |
Static creation. |
ZERO_v | ( | ) | [inline] |
operator ss_sint8_t | ( | ) | const [inline] |
A zero (of type ss_sint8_t).
operator ss_uint8_t | ( | ) | const [inline] |
A zero (of type ss_uint8_t).
operator ss_sint16_t | ( | ) | const [inline] |
A zero (of type ss_sint16_t).
operator ss_uint16_t | ( | ) | const [inline] |
A zero (of type ss_uint16_t).
operator ss_sint32_t | ( | ) | const [inline] |
A zero (of type ss_sint32_t).
operator ss_uint32_t | ( | ) | const [inline] |
A zero (of type ss_uint32_t).
operator float | ( | ) | const [inline] |
A zero (of type float).
operator double | ( | ) | const [inline] |
A zero (of type double).
operator long double | ( | ) | const [inline] |
A zero (of type long double).