How to get this to compile?
<p>I have this code which compiles and works as expected:</p>

<pre><code>class Right
{};

class Left
{
public:
  Left&amp; operator = (Right const&amp;)
  {
    //... Do something ...

    return *this;
  }
};


int main()
{
  Right right;
  Left left;

  // Assign individual object -- this works
  left = right;
}
</code></pre>

<p>But now, this one surprises me, I thought the template would work itself out since I already provided the <code>= operator()</code> to the <code>Left</code> class.</p>

<pre><code>int main()
{
  ...

  std::list&lt;Right&gt; rightLst;
  std::list&lt;Left&gt;  leftLst;

  // Assign a list of objects -- this doesn't compile
  leftLst = rightLst;
}
</code></pre>

<p>What can I do so that I could convert the <code>rightLst</code> to <code>leftLst</code> conversion in a single line?</p>

<p>Also, what if explicit keyword is used on Left? Then none of the proposed solutions will work, i.e. if Left is defined as:</p>

<pre><code>class Left
{
public:
  Left()
  {}
  explicit Left(Right const&amp; right_)
  {
    .. // Do something ..
  }
  Left&amp; operator = (Right const&amp; right_)
  {
    // .. Do something ..
    return *this;
  }
};
</code></pre>

<p>See, I'm trying to avoid writing this code below to achieve what I want to do:</p>

<pre><code>  for(std::list&lt;Right&gt;::iterator it  = rightLst.begin();
                                 it != rightLst.end();
                                 it++ )
  {
    leftLst.push_back(Left(*it));
  }
</code></pre>

<p>What code from STL I could re-use to replace the above?</p>
