Implementation of nullptr


#1

Cribbed this from Herb Sutter’s paper on the subject. It may or may not work, but it could stimulate ideas for replacing a macro with a language construct:

const  // this is a const object...
class {
public:
  template<class T>  // convertible to any type
  operator T*() const  // of null non-member
    { return 0; }  // pointer...
  template<class C, class T>  // or any type of null
  operator T C::*() const // member pointer...
    { return 0; }
private:
  void operator&() const;  // whose address can't be taken
} nullptr = {};  // and whose name is nullptr