title: cast operator between pointers
body: <p>Given my own struct type <code>X</code>, is it possible to define an implicit cast operator that enables implicit conversion of <code>X*</code> to some other type, say <code>int*</code>. While casting between references is easy, I cannot find how to do it for pointers. Something like this:</p>
  
  <pre><code>struct X {
      int theContent;
  
      operator int&amp;(){ return theContent; }
      operator const int&amp;() const { return theContent; }
  
  }
  
  int main(){
     X x;
     X* x2=&amp;x;
     // this should work, but it doesn't
     int* i=x2;
  }
  </code></pre>