Boost C++ Libraries: Ticket #12920: movelib::unique_ptr: incorrect pointer type for nested array https://svn.boost.org/trac10/ticket/12920 <p> When attempting to use <code>boost::movelib::unique_ptr</code> to store an array of, for example, <code>double[2]</code>, the type of the contained pointer ends up being <code>double *</code> instead of <code>double (*)[2]</code>, resulting in conversion errors and the inability to use <code>boost::movelib::unique_ptr</code> for this purpose. <code>std::unique_ptr</code> behaves as expected, so evidently Boost's implementation does not fully match the standard one. It seems like <code>remove_extent</code> is used one too many times. Below is a short example: </p> <pre class="wiki">#include &lt;memory&gt; #include &lt;functional&gt; #include &lt;boost/move/unique_ptr.hpp&gt; using boost::movelib::unique_ptr; typedef double C[2]; static_assert(std::is_same&lt;unique_ptr&lt;C[]&gt;::pointer, C*&gt;::value, "Pointer types must match"); static_assert(std::is_same&lt;unique_ptr&lt;C[]&gt;::element_type, C&gt;::value, "Element types must match"); int main() { unique_ptr&lt;C[], std::function&lt;void(C *)&gt; &gt; p1; unique_ptr&lt;C[]&gt; p2; return 0; } </pre><p> Replace line 5 with <code>using std::unique_ptr</code> to see that it works with the standard library's unique_ptr. Interestingly, as seen by the <code>static_assert</code>, only <code>pointer</code> has the wrong type; <code>element_type</code> is correct. </p> <p> Tested with Boost 1.59 and 1.63 with Xcode 8.2.1 on Mac OS X 10.12 and GCC 6 on Linux. </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/12920 Trac 1.4.3 Ion Gaztañaga Sun, 09 Apr 2017 11:49:40 GMT status changed; resolution set https://svn.boost.org/trac10/ticket/12920#comment:1 https://svn.boost.org/trac10/ticket/12920#comment:1 <ul> <li><strong>status</strong> <span class="trac-field-old">new</span> → <span class="trac-field-new">closed</span> </li> <li><strong>resolution</strong> → <span class="trac-field-new">fixed</span> </li> </ul> <p> Thanks for the report. Fixed in develop: </p> <p> <a class="ext-link" href="https://github.com/boostorg/move/commit/1dbc7bab5c421118c2e06c79f1994a04d23b40c3"><span class="icon">​</span>https://github.com/boostorg/move/commit/1dbc7bab5c421118c2e06c79f1994a04d23b40c3</a> </p> Ticket