language: C++ 4.7.2 (gcc-4.7.2)
date: 743 days 2 hours ago
link:
visibility: public
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#include <vector>
#include <algorithm>
#include <cassert>
 
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 = {};       
 
int main()
{
   int* ptr = NULL;
   assert( nullptr == ptr );
}