List of all members
blaze::Null Class Reference

Safe C++ NULL pointer implementation.This implementation offers a remedy for the use of the NULL pointer in C++. For this, the NULL macro is replaced by an instance of the Null class, which can only be assigned and compared with pointers and pointers-to-member. Therefore the use of NULL regains the type safety it lost in C++ due to the strict C++ type system.
The NULL pointer is used exactly as before: More...

#include <Null.h>

Public Member Functions

Constructor
 Null ()
 The default constructor of the Null class.
 
Conversion operators
template<typename T >
 operator T * () const
 Conversion operator to a pointer. More...
 
template<typename T , typename C >
 operator T C::* () const
 Conversion operator to a pointer-to-member. More...
 
Utility functions
template<typename T >
bool equal (const T *rhs) const
 Comparison between Null and a pointer. More...
 
template<typename T , typename C >
bool equal (const T C::*rhs) const
 Comparison between Null and a pointer-to-member. More...
 

Private Member Functions

Forbidden operations
 Null (const Null &n)
 Copy constructor (private & undefined)
 
Nulloperator= (const Null &n)
 Copy assignment operator (private & undefined)
 
void * operator& () const
 Address operator (private & undefined)
 

Detailed Description

Safe C++ NULL pointer implementation.

This implementation offers a remedy for the use of the NULL pointer in C++. For this, the NULL macro is replaced by an instance of the Null class, which can only be assigned and compared with pointers and pointers-to-member. Therefore the use of NULL regains the type safety it lost in C++ due to the strict C++ type system.
The NULL pointer is used exactly as before:

int* pi = NULL;
if( pi == NULL ) {...}

Member Function Documentation

template<typename T >
bool blaze::Null::equal ( const T *  rhs) const
inline

Comparison between Null and a pointer.

The function offers a type safe comparison between zero and an arbitrary pointer.

template<typename T , typename C >
bool blaze::Null::equal ( const T C::*  rhs) const
inline

Comparison between Null and a pointer-to-member.

The function offers a type safe comparison between zero and an arbitrary pointer-to-member.

template<typename T >
blaze::Null::operator T * ( ) const
inline

Conversion operator to a pointer.

This conversion operator offers a type safe conversion of zero to a pointer of any kind.

template<typename T , typename C >
blaze::Null::operator T C::* ( ) const
inline

Conversion operator to a pointer-to-member.

This conversion operator offers the type safe conversion of zero to a pointer-to-member of any kind.


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