5
#include <dune/common/nullptr.hh>
9
typedef Dune::nullptr_t NULLPTR_T;
10
char* ch = nullptr; // ch has the null pointer value
11
char* ch2 = 0; // ch2 has the null pointer value
13
int n = nullptr; // error
16
int n2 = 0; // n2 is zero
17
if( ch == 0 ); // evaluates to true
18
if( ch == nullptr ); // evaluates to true
19
if( nullptr == ch ); // evaluates to true
20
if( ch ); // evaluates to false
21
if( n2 == 0 ); // evaluates to true
24
if( n2 == nullptr ); // error
25
if( nullptr ); // error, no conversion to bool
26
if( nullptr == 0 ); // error
28
nullptr = 0; // error, nullptr is not an lvalue