Boost C++ Libraries: Ticket #6611: boost::pool_allocator construct() with single argument required by GCC 4.6 stl https://svn.boost.org/trac10/ticket/6611 <p> I tried to compile a MSVC code using custom std::vector/pool_allocator under win32/codeblocks (which uses GCC 4.6.0), and I get an error because on vector::resize() and underlying call _ _ uninitialized_default_a(), the stl implemented try to call _ _ alloc.construct() with a single placement address as argument. </p> <p> The thing is that boost:pool_allocator provides only one version of construct() which takes 2 arguments. Why isn't a "default" construct( const pointer&amp; ) implemented in pool_allocator ? Or why this version of the stl implements that ? Or what am I doing wrong ? </p> <p> Thanks </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/6611 Trac 1.4.3 viboes Mon, 28 May 2012 17:30:05 GMT component changed; owner set https://svn.boost.org/trac10/ticket/6611#comment:1 https://svn.boost.org/trac10/ticket/6611#comment:1 <ul> <li><strong>owner</strong> set to <span class="trac-author">Chris Newbold</span> </li> <li><strong>component</strong> <span class="trac-field-old">None</span> → <span class="trac-field-new">pool</span> </li> </ul> <p> Please set the component in the future if you want it to be analyzed. </p> Ticket Lars T. Kyllingstad <lars.kyllingstad@…> Fri, 02 Nov 2012 13:19:40 GMT version, type changed; cc set https://svn.boost.org/trac10/ticket/6611#comment:2 https://svn.boost.org/trac10/ticket/6611#comment:2 <ul> <li><strong>cc</strong> <span class="trac-author">lars.kyllingstad@…</span> added </li> <li><strong>version</strong> <span class="trac-field-old">Boost 1.48.0</span> → <span class="trac-field-new">Boost 1.51.0</span> </li> <li><strong>type</strong> <span class="trac-field-old">Support Requests</span> → <span class="trac-field-new">Bugs</span> </li> </ul> <p> I have run into the same problem when using the std::list constructor which only takes the list size. Here is a test case: </p> <pre class="wiki">#include &lt;list&gt; #include &lt;boost/pool/pool_alloc.hpp&gt; void foo() { typedef boost::fast_pool_allocator&lt;int&gt; Alloc; std::list&lt;int, Alloc&gt; myList(3); } </pre><p> Compiled with GCC 4.6.1 using <code>-std=c++0x</code> and Boost 1.51.0, this results in the following errors: </p> <pre class="wiki">/usr/include/c++/4.6/bits/stl_list.h: In member function ‘std::list&lt;_Tp, _Alloc&gt;::_Node* std::list&lt;_Tp, _Alloc&gt;::_M_create_node(_Args&amp;&amp; ...) [with _Args = {}, _Tp = int, _Alloc = boost::fast_pool_allocator&lt;int&gt;, std::list&lt;_Tp, _Alloc&gt;::_Node = std::_List_node&lt;int&gt;]’: /usr/include/c++/4.6/bits/stl_list.h:1523:63: instantiated from ‘void std::list&lt;_Tp, _Alloc&gt;::_M_insert(std::list&lt;_Tp, _Alloc&gt;::iterator, _Args&amp;&amp; ...) [with _Args = {}, _Tp = int, _Alloc = boost::fast_pool_allocator&lt;int&gt;, std::list&lt;_Tp, _Alloc&gt;::iterator = std::_List_iterator&lt;int&gt;]’ /usr/include/c++/4.6/bits/stl_list.h:998:11: instantiated from ‘void std::list&lt;_Tp, _Alloc&gt;::emplace_back(_Args&amp;&amp; ...) [with _Args = {}, _Tp = int, _Alloc = boost::fast_pool_allocator&lt;int&gt;]’ /usr/include/c++/4.6/bits/stl_list.h:1474:4: instantiated from ‘void std::list&lt;_Tp, _Alloc&gt;::_M_default_initialize(std::list&lt;_Tp, _Alloc&gt;::size_type) [with _Tp = int, _Alloc = boost::fast_pool_allocator&lt;int&gt;, std::list&lt;_Tp, _Alloc&gt;::size_type = unsigned int]’ /usr/include/c++/4.6/bits/stl_list.h:534:9: instantiated from ‘std::list&lt;_Tp, _Alloc&gt;::list(std::list&lt;_Tp, _Alloc&gt;::size_type) [with _Tp = int, _Alloc = boost::fast_pool_allocator&lt;int&gt;, std::list&lt;_Tp, _Alloc&gt;::size_type = unsigned int]’ a.cpp:7:35: instantiated from here /usr/include/c++/4.6/bits/stl_list.h:494:8: error: no matching function for call to ‘boost::fast_pool_allocator&lt;std::_List_node&lt;int&gt;, boost::default_user_allocator_new_delete, boost::mutex, 32u, 0u&gt;::construct(std::list&lt;int, boost::fast_pool_allocator&lt;int&gt; &gt;::_Node*&amp;)’ /usr/include/c++/4.6/bits/stl_list.h:494:8: note: candidate is: /home/larky/.local/include/boost/pool/pool_alloc.hpp:398:10: note: void boost::fast_pool_allocator&lt;T, UserAllocator, Mutex, NextSize, MaxSize&gt;::construct(boost::fast_pool_allocator&lt;T, UserAllocator, Mutex, NextSize, MaxSize&gt;::pointer, const value_type&amp;) [with T = std::_List_node&lt;int&gt;, UserAllocator = boost::default_user_allocator_new_delete, Mutex = boost::mutex, unsigned int NextSize = 32u, unsigned int MaxSize = 0u, boost::fast_pool_allocator&lt;T, UserAllocator, Mutex, NextSize, MaxSize&gt;::pointer = std::_List_node&lt;int&gt;*, boost::fast_pool_allocator&lt;T, UserAllocator, Mutex, NextSize, MaxSize&gt;::value_type = std::_List_node&lt;int&gt;] /home/larky/.local/include/boost/pool/pool_alloc.hpp:398:10: note: candidate expects 2 arguments, 1 provided </pre><p> I have changed the ticket type to "Bugs", since this version of Boost claims to support C++11 mode in GCC 4.6. </p> Ticket anonymous Tue, 20 Aug 2013 13:51:28 GMT <link>https://svn.boost.org/trac10/ticket/6611#comment:3 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/6611#comment:3</guid> <description> <p> Still broken in 1.54.0 </p> </description> <category>Ticket</category> </item> <item> <dc:creator>anonymous</dc:creator> <pubDate>Wed, 06 Nov 2013 15:57:50 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/6611#comment:4 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/6611#comment:4</guid> <description> <p> I'm facing the same issue. Any updates. </p> </description> <category>Ticket</category> </item> </channel> </rss>