Implicit Conversion to a user-defined type
<p>The following code works fine.</p>

<pre><code>class A
{
   private:
   int _value;
   public:
   class AProxy
   {
     public:
     AProxy(int num):_num(num){}
     int _num;
   };
   A(AProxy x):_value(x._num){}
   int getvalue(){
        return _value;
   }
};

void func(A a)
{
  cout&lt;&lt;"A is initialized with "&lt;&lt;a.getvalue()&lt;&lt;endl;
}

int main()
{
   A a(10);   
   return 0;
}  
</code></pre>

<p>a(10) gets converted to a(Aproxy(10))</p>

<p>However, the following code do not work.</p>

<pre><code>class A
{
   private:
   int _value;

   public:
   class AProxy
   {
     class AAProxy
     {
     public:
     AAProxy(int num):_aanum(num){}
     int _aanum;
     };
     public:
     AProxy(AAProxy aa):_num(aa._aanum){}
     int _num;
   };
   A(AProxy x):_value(x._num){}
   int getvalue(){
        return _value;
   }
};

void func(A a)
{
  cout&lt;&lt;"A is initialized with "&lt;&lt;a.getvalue()&lt;&lt;endl;
}

int main()
{
   A a(10);
   return 0;
}
</code></pre>

<p>a(10) -> a(Aproxy(AAproxy(10))). So the implicit conversion from int to a user-defined type, happens only once ?</p>
