 <p>Your struct here:</p> <blockquote> <pre><code>struct weighted_pointer{ mutable int weight; unique_ptr&lt;likeatree&gt; ptr; }; </code></pre> </blockquote> <p>contains a <code>std::unique_ptr</code>. A <code>std::unique_ptr</code> cannot be copied, so your entire <code>weighted_pointer</code> cannot be copied as well.</p> <p>There are three places in your code where you attempt to copy it, which causes the errors you see:</p> <blockquote> <pre><code>bool operator()(const weighted_pointer lhs, const weighted_pointer rhs) { </code></pre> </blockquote> <p>Must be:</p> <pre><code>bool operator()(weighted_pointer const&amp; lhs, weighted_pointer const&amp; rhs) { </code></pre> <blockquote> <pre><code>stdSet.insert(tmp); </code></pre> </blockquote> <p>This could theoretically be fixed by:</p> <pre><code>stdSet.insert(std::move(tmp)); </code></pre> <p>However, you then cannot use <code>tmp</code> anymore, which you do, not only in the same loop but also in the loop below. So you must find a different solution altogether. Perhaps use <code>emplace</code>. Or restructure your code entirely.</p> <blockquote> <pre><code>auto it = find_if(stdSet.begin(),stdSet.end(),[&amp;](weighted_pointer temp){ return temp.ptr.get() == treeVector[i]; }); </code></pre> </blockquote> <p>Must be:</p> <pre><code>auto it = find_if(stdSet.begin(),stdSet.end(),[&amp;](weighted_pointer const&amp; temp){ return temp.ptr.get() == treeVector[i]; }); </code></pre> <hr> <p>For VC++ 2013, the <code>std::move</code> fix will not suffice. You will have to add an explicit move constructor to your struct:</p> <pre><code>struct weighted_pointer{ mutable int weight; unique_ptr&lt;likeatree&gt; ptr; weighted_pointer() = default; weighted_pointer(weighted_pointer&amp;&amp; src) : weight(std::move(src.weight)), ptr(std::move(src.ptr)) { } }; </code></pre> <p>VC++ 2015 fixes this problem. More information: <a href="http://stackoverflow.com/questions/26581262/default-move-constructor-in-visual-studio-2013-update-3">Default Move Constructor in Visual Studio 2013 (Update 3)</a></p>