How to show default c++ object value
<p>I would like to create a c++ type that mimic the build-in type exactly.  Below is an example of an "integer" type that "boxed in" an "int" type.  Problem I have is, I want to show the value of "integer" using only the stand alone "integer" object d, such that cout &lt;&lt; d will show the value, not cout &lt;&lt; d.show ( );  how would I do that ?</p>

<pre><code>#include &lt;iostream&gt;

class integer {

      public:
             integer (int x)  { i = x; };
             integer ( ) { };   // default constructor

      integer operator+ (integer&amp; c ){
              return integer(i + c.i);
          }


      int show ( ) { return i; }


      private:
              int i;
};



int main ( ) {

    integer i = 5;
    integer c (10);
    integer d;

    d = i + c;

    std::cout &lt;&lt; d.show() &lt;&lt; std::endl;

    std::cin.get();
    return 0;   
}
</code></pre>
