- Main Page
- Namespaces
- Classes
- Files

- File List
- File Members

# D:/Programmation/Sources/Tensor2/Utils/include/frost_utils_nullptr.h

Go to the documentation of this file.

    00001 // Warning : If you need to use this file, include frost_utils_types.h
    00002 namespace Frost
    00003 {
    00004     /// Null pointer
    00005     /** A safe replacement for the NULL macro.
    00006     */
    00007     class s_nullptr
    00008     {
    00009     public :
    00010
    00011         /// Default constructor.
    00012         s_nullptr()
    00013         {
    00014         }
    00015
    00016         /// Allows : "if (!pPointer)".
    00017         bool operator ! () const
    00018         {
    00019             return true;
    00020         }
    00021
    00022         typedef void (s_nullptr::*MemberFn)();
    00023         /// Allows : "if (pPointer)".
    00024         operator MemberFn() const
    00025         {
    00026             return 0;
    00027         }
    00028
    00029         /// Allows usage with raw pointers.
    00030         template<class N>
    00031         operator N*() const
    00032         {
    00033             return 0;
    00034         }
    00035     };
    00036
    00037     const s_nullptr nullptr;
    00038 }