Replacing a set object with a new set object
<p>I have a class with a private field:</p>

<pre><code>std::set&lt;std::string&gt; _channelNames;
</code></pre>

<p>.. and an optional setter function:</p>

<pre><code>void setChannelNames(std::set channelNames);
</code></pre>

<p>In the setter function, how do I replace the private _channelNames field with the one passed from the setter function?</p>

<p>I tried:</p>

<pre><code>void Parser::setChannelNames(std::set channelNames) {
    this-&gt;_channelNames = channelNames;
}
</code></pre>

<p>But this produced an error in VS2005:</p>

<pre><code>Error   2   error C2679: binary '=' : no operator found which takes a right-hand operand of type 'std::set' (or there is no acceptable conversion)   parser.cpp 61
</code></pre>

<p>I am definitely a C++ novice, and expect that I should be doing some pointer work here instead.</p>

<p>Any quick tips?</p>

<p>Thanks!</p>
