title: Avoid null pointer checks in C++
body: <p>Use case:</p>
  
  <pre><code>class B {
  
       int b;
       public:
           int getB() { 
                 return b;
           }
   };
  
  class A {
          B *b;
      public:
            int getB() {
                if (b ) {                      //How can I avoid the null check for b here
                    return b-&gt;getB();
                }
            }
    }
  </code></pre>