Boost C++ Libraries: Ticket #6648: managed_unique_ptr cannot be used inside template (VS2008). https://svn.boost.org/trac10/ticket/6648 <p> There is a very simple example: </p> <div class="wiki-code"><div class="code"><pre><span class="cp">#include</span> <span class="cpf">&lt;iostream&gt;</span><span class="cp"></span> <span class="cp">#include</span> <span class="cpf">&lt;boost/interprocess/managed_windows_shared_memory.hpp&gt;</span><span class="cp"></span> <span class="cp">#include</span> <span class="cpf">&lt;boost/interprocess/smart_ptr/unique_ptr.hpp&gt;</span><span class="cp"></span> <span class="cp">#include</span> <span class="cpf">&lt;boost/interprocess/allocators/allocator.hpp&gt;</span><span class="cp"></span> <span class="cp">#include</span> <span class="cpf">&lt;boost/interprocess/containers/list.hpp&gt;</span><span class="cp"></span> <span class="cp">#include</span> <span class="cpf">&lt;boost/interprocess/sync/named_mutex.hpp&gt;</span><span class="cp"></span> <span class="cp">#include</span> <span class="cpf">&lt;boost/interprocess/sync/named_condition.hpp&gt;</span><span class="cp"></span> <span class="cp">#include</span> <span class="cpf">&lt;boost/interprocess/sync/scoped_lock.hpp&gt;</span><span class="cp"></span> <span class="k">struct</span> <span class="n">Request</span> <span class="p">{</span> <span class="kt">int</span> <span class="n">a</span><span class="p">;</span> <span class="p">};</span> <span class="k">template</span><span class="o">&lt;</span><span class="k">typename</span> <span class="n">Segment</span><span class="p">,</span> <span class="k">typename</span> <span class="n">T</span><span class="o">&gt;</span> <span class="k">class</span> <span class="nc">Channel</span> <span class="p">{</span> <span class="k">public</span><span class="o">:</span> <span class="c1">/// Value pointer in queue.</span> <span class="k">typedef</span> <span class="k">typename</span> <span class="n">boost</span><span class="o">::</span><span class="n">interprocess</span><span class="o">::</span><span class="n">managed_unique_ptr</span><span class="o">&lt;</span><span class="n">T</span><span class="p">,</span> <span class="n">Segment</span><span class="o">&gt;::</span><span class="n">type</span> <span class="n">ValuePtr</span><span class="p">;</span> <span class="p">};</span> <span class="kt">int</span> <span class="nf">main</span><span class="p">(</span><span class="kt">int</span> <span class="n">argc</span><span class="p">,</span> <span class="kt">char</span><span class="o">*</span> <span class="n">argv</span><span class="p">[])</span> <span class="p">{</span> <span class="n">Channel</span><span class="o">&lt;</span><span class="n">boost</span><span class="o">::</span><span class="n">interprocess</span><span class="o">::</span><span class="n">managed_windows_shared_memory</span><span class="p">,</span> <span class="n">Request</span><span class="o">&gt;::</span><span class="n">ValuePtr</span> <span class="n">v</span><span class="p">;</span> <span class="n">std</span><span class="o">::</span><span class="n">cout</span> <span class="o">&lt;&lt;</span> <span class="s">&quot;Test&quot;</span> <span class="o">&lt;&lt;</span> <span class="n">std</span><span class="o">::</span><span class="n">endl</span><span class="p">;</span> <span class="k">return</span> <span class="mi">0</span><span class="p">;</span> <span class="p">}</span> </pre></div></div><p> I got this error in Visual Studio 2008: </p> <pre class="wiki">T.cpp C:\Program Files\boost\boost_1_49_0\boost/interprocess/detail/pointer_type.hpp(64) : error C2039: 'remove_reference' : is not a member of 'boost::interprocess::ipcdetail::ipcdetail' C:\Program Files\boost\boost_1_49_0\boost/interprocess/smart_ptr/unique_ptr.hpp(94) : see reference to class template instantiation 'boost::interprocess::ipcdetail::pointer_type&lt;T,D&gt;' being compiled with [ T=Request, D=boost::interprocess::deleter&lt;Request,boost::interprocess::segment_manager&lt;char,boost::interprocess::rbtree_best_fit&lt;boost::interprocess::mutex_family&gt;,boost::interprocess::iset_index&gt;&gt; ] T.cpp(34) : see reference to class template instantiation 'boost::interprocess::unique_ptr&lt;T,D&gt;' being compiled with [ T=Request, D=boost::interprocess::deleter&lt;Request,boost::interprocess::segment_manager&lt;char,boost::interprocess::rbtree_best_fit&lt;boost::interprocess::mutex_family&gt;,boost::interprocess::iset_index&gt;&gt; ] C:\Program Files\boost\boost_1_49_0\boost/interprocess/detail/pointer_type.hpp(64) : error C2947: expecting '&gt;' to terminate template-argument-list, found '&lt;' C:\Program Files\boost\boost_1_49_0\boost/interprocess/detail/pointer_type.hpp(64) : error C3203: 'remove_reference' : unspecialized class template can't be used as a template argument for template parameter 'D', expected a real type C:\Program Files\boost\boost_1_49_0\boost/interprocess/detail/pointer_type.hpp(64) : error C2955: 'boost::interprocess::ipcdetail::remove_reference' : use of class template requires template argument list C:\Program Files\boost\boost_1_49_0\boost/interprocess/detail/type_traits.hpp(30) : see declaration of 'boost::interprocess::ipcdetail::remove_reference' C:\Program Files\boost\boost_1_49_0\boost/interprocess/detail/pointer_type.hpp(64) : error C2143: syntax error : missing ';' before '&gt;' C:\Program Files\boost\boost_1_49_0\boost/interprocess/detail/pointer_type.hpp(64) : error C2039: 'type' : is not a member of '`global namespace'' C:\Program Files\boost\boost_1_49_0\boost/interprocess/detail/pointer_type.hpp(64) : error C2039: 'type' : is not a member of '`global namespace'' C:\Program Files\boost\boost_1_49_0\boost/interprocess/detail/pointer_type.hpp(64) : error C2238: unexpected token(s) preceding ';' C:\Program Files\boost\boost_1_49_0\boost/interprocess/smart_ptr/unique_ptr.hpp(94) : error C2039: 'type' : is not a member of 'boost::interprocess::ipcdetail::pointer_type&lt;T,D&gt;' ................ </pre><p> This example works fine in boost 1.48.0 </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/6648 Trac 1.4.3 Ion Gaztañaga Thu, 30 Jun 2016 20:40:45 GMT status changed; resolution set https://svn.boost.org/trac10/ticket/6648#comment:1 https://svn.boost.org/trac10/ticket/6648#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> This error can't be reproduced in the latest (1.61) version so closed as fixed. </p> Ticket