Boost C++ Libraries: Ticket #3536: ptr_map doesn't support incomplete type with view clone allocator https://svn.boost.org/trac10/ticket/3536 <pre class="wiki">#include &lt;boost/ptr_container/ptr_map.hpp&gt; class C; int main() { boost::ptr_map&lt;int, C, boost::view_clone_allocator&gt; c; return 0; } boost\checked_delete.hpp(32) : error C2027: use of undefined type 'C' c:\documents and settings\internet\my documents\visual studio 2008\projects\test\test.cpp(3) : see declaration of 'C' boost\ptr_container\clone_allocator.hpp(56) : see reference to function template instantiation 'void boost::checked_delete&lt;const T&gt;(T *)' being compiled with [ T=C ] boost\ptr_container\clone_allocator.hpp(74) : see reference to function template instantiation 'void boost::delete_clone&lt;U&gt;(const T *)' being compiled with [ U=C, T=C ] boost\ptr_container\detail\reversible_ptr_container.hpp(126) : see reference to function template instantiation 'void boost::heap_clone_allocator::deallocate_clone&lt;C&gt;(const U *)' being compiled with [ U=C ] boost\ptr_container\detail\reversible_ptr_container.hpp(119) : while compiling class template member function 'void boost::ptr_container_detail::reversible_ptr_container&lt;Config,CloneAllocator&gt;::null_clone_allocator&lt;allow_null_values&gt;::deallocate_clone(const C *)' with [ Config=boost::ptr_container_detail::map_config&lt;C,std::map&lt;int,void *,boost::view_clone_allocator,std::allocator&lt;std::pair&lt;const int,void *&gt;&gt;&gt;,true&gt;, CloneAllocator=boost::heap_clone_allocator, allow_null_values=false ] boost\ptr_container\detail\reversible_ptr_container.hpp(276) : see reference to class template instantiation 'boost::ptr_container_detail::reversible_ptr_container&lt;Config,CloneAllocator&gt;::null_clone_allocator&lt;allow_null_values&gt;' being compiled with [ Config=boost::ptr_container_detail::map_config&lt;C,std::map&lt;int,void *,boost::view_clone_allocator,std::allocator&lt;std::pair&lt;const int,void *&gt;&gt;&gt;,true&gt;, CloneAllocator=boost::heap_clone_allocator, allow_null_values=false ] boost\ptr_container\detail\reversible_ptr_container.hpp(275) : while compiling class template member function 'void boost::ptr_container_detail::reversible_ptr_container&lt;Config,CloneAllocator&gt;::null_policy_deallocate_clone(const C *)' with [ Config=boost::ptr_container_detail::map_config&lt;C,std::map&lt;int,void *,boost::view_clone_allocator,std::allocator&lt;std::pair&lt;const int,void *&gt;&gt;&gt;,true&gt;, CloneAllocator=boost::heap_clone_allocator ] boost\ptr_container\detail\associative_ptr_container.hpp(34) : see reference to class template instantiation 'boost::ptr_container_detail::reversible_ptr_container&lt;Config,CloneAllocator&gt;' being compiled with [ Config=boost::ptr_container_detail::map_config&lt;C,std::map&lt;int,void *,boost::view_clone_allocator,std::allocator&lt;std::pair&lt;const int,void *&gt;&gt;&gt;,true&gt;, CloneAllocator=boost::heap_clone_allocator ] boost\ptr_container\ptr_map_adapter.hpp(130) : see reference to class template instantiation 'boost::ptr_container_detail::associative_ptr_container&lt;Config,CloneAllocator&gt;' being compiled with [ Config=boost::ptr_container_detail::map_config&lt;C,std::map&lt;int,void *,boost::view_clone_allocator,std::allocator&lt;std::pair&lt;const int,void *&gt;&gt;&gt;,true&gt;, CloneAllocator=boost::heap_clone_allocator ] boost\ptr_container\ptr_map_adapter.hpp(388) : see reference to class template instantiation 'boost::ptr_container_detail::ptr_map_adapter_base&lt;T,VoidPtrMap,CloneAllocator,Ordered&gt;' being compiled with [ T=C, VoidPtrMap=std::map&lt;int,void *,boost::view_clone_allocator,std::allocator&lt;std::pair&lt;const int,void *&gt;&gt;&gt;, CloneAllocator=boost::heap_clone_allocator, Ordered=true ] boost\ptr_container\ptr_map.hpp(36) : see reference to class template instantiation 'boost::ptr_map_adapter&lt;T,VoidPtrMap,CloneAllocator&gt;' being compiled with [ T=C, VoidPtrMap=std::map&lt;int,void *,boost::view_clone_allocator,std::allocator&lt;std::pair&lt;const int,void *&gt;&gt;&gt;, CloneAllocator=boost::heap_clone_allocator ] c:\documents and settings\internet\my documents\visual studio 2008\projects\test\test.cpp(7) : see reference to class template instantiation 'boost::ptr_map&lt;Key,T,Compare&gt;' being compiled with [ Key=int, T=C, Compare=boost::view_clone_allocator ] boost\checked_delete.hpp(32) : error C2118: negative subscript boost\checked_delete.hpp(34) : warning C4150: deletion of pointer to incomplete type 'C'; no destructor called c:\documents and settings\internet\my documents\visual studio 2008\projects\test\test.cpp(3) : see declaration of 'C' </pre> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/3536 Trac 1.4.3 Steven Watanabe Wed, 28 Oct 2009 01:42:48 GMT component changed; owner set https://svn.boost.org/trac10/ticket/3536#comment:1 https://svn.boost.org/trac10/ticket/3536#comment:1 <ul> <li><strong>owner</strong> set to <span class="trac-author">Thorsten Ottosen</span> </li> <li><strong>component</strong> <span class="trac-field-old">None</span> → <span class="trac-field-new">ptr_container</span> </li> </ul> Ticket Steven Watanabe Wed, 28 Oct 2009 01:49:38 GMT status changed; resolution set https://svn.boost.org/trac10/ticket/3536#comment:2 https://svn.boost.org/trac10/ticket/3536#comment:2 <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">invalid</span> </li> </ul> <p> Check the template arguments for ptr_map. </p> <pre class="wiki"> template &lt; class Key, class T, class Compare = std::less&lt;Key&gt;, class CloneAllocator = heap_clone_allocator, class Allocator = std::allocator&lt; std::pair&lt;const Key,void*&gt; &gt; &gt; class ptr_map; </pre><p> You're passing view_clone_allocator as Compare instead of as <a class="missing wiki">CloneAllocator</a>. </p> Ticket olafvdspek@… Wed, 28 Oct 2009 09:04:41 GMT <link>https://svn.boost.org/trac10/ticket/3536#comment:3 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/3536#comment:3</guid> <description> <p> Oops, sorry, my mistake. </p> </description> <category>Ticket</category> </item> </channel> </rss>