NULL_v Struct Reference
[Utility Library]

#include <stlsoft/util/null.hpp>

List of all members.


Detailed Description

Represents a type that can be an active replacement for NULL.

This class can act as a replacement for the NULL macro, by being validly assigned to or equated with pointer types only, as in

int i = NULL; // error int *p = NULL; // OK

if(i == NULL) {} // error if(NULL == i) {} // error

if(p == NULL) {} // OK if(NULL == p) {} // OK

When used via inclusion of the file stlsoft_nulldef.h, the macro NULL is redefined as NULL_v(), such that expressions containing NULL will be valid against pointers only.

Public Member Functions

 NULL_v ()
 Default constructor.
template<typename T>
 operator T * () const
 Implicit conversion operator (convertible to any pointer type).
template<typename T2, typename C>
 operator T2 C::* () const
 Implicit conversion operator (convertible to any pointer type).
template<typename T>
bool equal (T const &rhs) const
 Evaluates whether an instance of a type is null.
template<typename T>
bool equals (T const &rhs) const

Static Public Member Functions

static NULL_v create ()
 Static creation.


Constructor & Destructor Documentation

NULL_v (  )  [inline]

Default constructor.

Referenced by NULL_v::create().


Member Function Documentation

operator T * (  )  const [inline]

Implicit conversion operator (convertible to any pointer type).

operator T2 C::* (  )  const [inline]

Implicit conversion operator (convertible to any pointer type).

bool equal ( T const &  rhs  )  const [inline]

Evaluates whether an instance of a type is null.

Parameters:
rhs A reference arbitrary type which will be compared to null

bool equals ( T const &  rhs  )  const [inline]


The documentation for this struct was generated from the following file:

Generated on Thu Jun 10 08:59:02 2010 for STLSoft by  doxygen 1.5.6