res; color: #848784">// values while the list methods can swap pointers</span><span style="font: 11.0px Menlo; font-variant-ligatures: no-common-ligatures"><br/>
l.erase(std::remove(l.begin(), l.end(),</span> <span style="font: 11.0px Menlo; font-variant-ligatures: no-common-ligatures; color: #f32300">2</span><span style="font: 11.0px Menlo; font-variant-ligatures: no-common-ligatures">), l.end());<br/>
<br/></span><span style="font: 11.0px Menlo; font-variant-ligatures: no-common-ligatures; color: #848784"