title: Overloading operator-> in C++
body: <p>I have a smart pointer class and I want to overload <code>operator-&gt;</code>; it's provided for convenience so I can access the members of the class contained inside the smart pointer directly.</p>
  
  <p>I was looking at the way Boost implements this operator in its <code>shared_ptr</code> template. I noticed they added an assert checking if the pointer is indeed non-null before returning it. Currently, my operator returns the pointer without checking if it's null (essentially, a null pointer is undefined behavior in my current implementation). Should I add this assert as well?</p>
  
  <p>(Also, how is this operator called? I couldn't find this on the web.)</p>