title: unique_ptr trouble? (VS 2015)
body: <p>I’ve just copied some code from here <a href="http://en.cppreference.com/w/cpp/language/pimpl" rel="nofollow noreferrer">http://en.cppreference.com/w/cpp/language/pimpl</a>, added <code>&lt;memory&gt;</code> and <code>main.cpp</code>, corrected <code>std::experimental::propagate_const&lt;std::unique_ptr&lt;impl&gt;&gt;</code>. Visual Studio <strong>2015.</strong></p>
  
  <pre><code>// widget.h
  #include &lt;memory&gt;
  
  class widget
  {
      // public members
  private:
      struct impl;
      std::unique_ptr&lt;impl&gt; pImpl;
  };
  </code></pre>
  
  <p>.</p>
  
  <pre><code>// widget.cpp
  #include "widget.h"
  
  struct widget::impl {
      // implementation details
  };
  </code></pre>
  
  <p><code>widget.cpp</code> is compiled fine, but <code>main.cpp</code> is not.</p>
  
  <pre><code>#include "widget.h"
  
  int main()
  {
      widget w;
  }
  </code></pre>
  
  <p>Error messages.</p>
  
  <pre><code>1&gt;c:\program files (x86)\microsoft visual studio 14.0\vc\include\memory(1193): error C2027: use of undefined type 'widget::impl'
  1&gt;  e:\***\***\***\widget.h(8): note: see declaration of 'widget::impl'
  1&gt;  c:\program files (x86)\microsoft visual studio 14.0\vc\include\memory(1192): note: while compiling class template member function 'void std::default_delete&lt;_Ty&gt;::operator ()(_Ty *) noexcept const'
  1&gt;          with
  1&gt;          [
  1&gt;              _Ty=widget::impl
  1&gt;          ]
  1&gt;  c:\program files (x86)\microsoft visual studio 14.0\vc\include\memory(1397): note: see reference to function template instantiation 'void std::default_delete&lt;_Ty&gt;::operator ()(_Ty *) noexcept const' being compiled
  1&gt;          with
  1&gt;          [
  1&gt;              _Ty=widget::impl
  1&gt;          ]
  1&gt;  c:\program files (x86)\microsoft visual studio 14.0\vc\include\memory(1227): note: see reference to class template instantiation 'std::default_delete&lt;_Ty&gt;' being compiled
  1&gt;          with
  1&gt;          [
  1&gt;              _Ty=widget::impl
  1&gt;          ]
  1&gt;  c:\program files (x86)\microsoft visual studio 14.0\vc\include\memory(1236): note: see reference to class template instantiation 'std::_Get_deleter_pointer_type&lt;_Ty,std::default_delete&lt;_Ty&gt;&gt;' being compiled
  1&gt;          with
  1&gt;          [
  1&gt;              _Ty=widget::impl
  1&gt;          ]
  1&gt;  c:\program files (x86)\microsoft visual studio 14.0\vc\include\memory(1279): note: see reference to class template instantiation 'std::_Unique_ptr_base&lt;_Ty,_Dx&gt;' being compiled
  1&gt;          with
  1&gt;          [
  1&gt;              _Ty=widget::impl,
  1&gt;              _Dx=std::default_delete&lt;widget::impl&gt;
  1&gt;          ]
  1&gt;  e:\***\***\***\***.h(10): note: see reference to class template instantiation 'std::unique_ptr&lt;widget::impl,std::default_delete&lt;_Ty&gt;&gt;' being compiled
  1&gt;          with
  1&gt;          [
  1&gt;              _Ty=widget::impl
  1&gt;          ]
  1&gt;c:\program files (x86)\microsoft visual studio 14.0\vc\include\memory(1194): error C2338: can't delete an incomplete type
  1&gt;c:\program files (x86)\microsoft visual studio 14.0\vc\include\memory(1195): warning C4150: deletion of pointer to incomplete type 'widget::impl'; no destructor called
  1&gt;  e:\***\***\***\widget.h(8): note: see declaration of 'widget::impl'
  </code></pre>