error: declared here unique_ptr(const unique_ptr&) = delete;
<p>This codes compiles successfully.</p>

<pre><code>#include&lt;iostream&gt;
#include&lt;memory&gt;
using namespace std;
class A{
        public:
        unique_ptr&lt;A&gt; myval;
        A(){ cout&lt;&lt;"Constrcutor of A is called"&lt;&lt;endl; }
        ~A(){cout&lt;&lt;"Destructor of A is called"&lt;&lt;endl;}
        unique_ptr&lt;A&gt; getsomething()
        {
                unique_ptr&lt;A&gt; myval;
                myval.reset(new A);
                return myval;
        }
};
</code></pre>

<p>but when I comment local<code>unique_ptr&lt;A&gt; myval;</code> compiler throws error.</p>

<pre><code>shared_test.cpp: In member function ‘std::unique_ptr&lt;A&gt; A::getsomething()’:
shared_test.cpp:12:10: error: use of deleted function ‘std::unique_ptr&lt;_Tp, _Dp&gt;::unique_ptr(const std::unique_ptr&lt;_Tp, _Dp&gt;&amp;) [with _Tp = A; _Dp = std::default_delete&lt;A&gt;]’
   return myval;
          ^
In file included from /usr/include/c++/4.8/memory:81:0,
                 from shared_test.cpp:2:
/usr/include/c++/4.8/bits/unique_ptr.h:273:7: error: declared here
       unique_ptr(const unique_ptr&amp;) = delete;
       ^
</code></pre>

<p>I am not able to understand what this error says. What is it?</p>