00001 #ifndef DUNE_NULLPTR_HH 00002 #define DUNE_NULLPTR_HH 00003 00004 #if ! HAVE_NULLPTR 00005 00012 const // this is a const object... 00013 class dune_nullptr_t { // of type nullptr_t 00014 public: 00015 template<class T> // convertible to any type 00016 operator T*() const // of null non-member 00017 { return 0; } // pointer... 00018 template<class C, class T> // or any type of null 00019 operator T C::*() const // member pointer... 00020 { return 0; } 00021 private: 00022 void operator&() const; // whose address can't be taken 00023 } nullptr = {}; // and whose name is nullptr 00024 00025 typedef dune_nullptr_t nullptr_t; 00026 00027 #endif // HAVE_NULLPTR 00028 00029 #endif // DUNE_NULLPTR_HH