title: Overloading assignment operator when the object is on the right-hand side of the assignment
body: <p>Given the following code:</p>
  
  <pre><code>template &lt;typename T&gt;
  struct Wrapper {
      T value;
      Wrapper(T val) : value(val) {}
  }
  
  int main() {
      Wrapper&lt;int&gt; x(42);
      int y = x; // need solution for y = x.value
      return 0;
   }
  </code></pre>
  
  <p>Is there a way to implement the assignment </p>
  
  <pre><code>int y = x;
  </code></pre>
  
  <p>so that it means y = x.value .</p>
  
  <p>I know that overloading the assignment operator itself is not possible because it applies to the object on the left side of the assignment and friend function with two arguments is not allowed by the standard.</p>
  
  <p>If this is not possible by overloading any other operator, or by using some special tricks, how would you implement this, except by invoking the get method provided by the Wrapper class such as:</p>
  
  <pre><code>int y = x.get();
  </code></pre>