title: C++ memory access violation on trying to deep copy a unique pointer
body: <p>So I have the following class as such:</p>
  
  <pre><code>class foo{
  public:
    unique_ptr&lt;someClass&gt; pt;
  Foo(){}
  //Copy constructor
  Foo(Foo&amp; f){
    someClass * copy = f.pt.get();
    pt=unique_ptr&lt;someClass&gt;(copy);
  }
  
  };
  </code></pre>
  
  <p>So the above code works as intended, the copy constructor will make the current class have an exact copy of the given class. But, it also gives me a memory access violation. I tried debugging it on valgrind, but it says it has something to do with the default delete on the unique_ptr class. However, at no point in my code do I call delete.</p>
  
  <p>I was wondering if there was a way to remove these memory access violations, or if there is another step I am missing to this.</p>