Boost C++ Libraries: Ticket #7321: freelist_stack::allocate and freelist_stack::deallocate should not be private https://svn.boost.org/trac10/ticket/7321 <p> Currently, the allocate/deallocate functions et.al. in lockfree::detail::freelist_stack are private. This inhibits reusing this class for implementing other lock-free datastructures as it's not possible to allocate anything which has not a constructor taking 0, 1, or 2 arguments (those are supported explicitly by exposing overloads for freelist_stack::construct). </p> <p> Would it be possible to make the mentioned functions 'protected' instead? </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/7321 Trac 1.4.3 timblechmann Mon, 03 Sep 2012 10:11:08 GMT <link>https://svn.boost.org/trac10/ticket/7321#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/7321#comment:1</guid> <description> <p> making allocate protected. deallocate should not be required, as one can still use the destruct method. </p> <p> however in general it would be cleaner to use an api like this: </p> <pre class="wiki">template &lt;class... Args&gt; T * construct(Args&amp;&amp;... args) </pre> </description> <category>Ticket</category> </item> <item> <dc:creator>Hartmut Kaiser</dc:creator> <pubDate>Mon, 03 Sep 2012 12:55:36 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/7321#comment:2 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/7321#comment:2</guid> <description> <p> Replying to <a class="ticket" href="https://svn.boost.org/trac10/ticket/7321#comment:1" title="Comment 1">timblechmann</a>: </p> <blockquote class="citation"> <p> making allocate protected. deallocate should not be required, as one can still use the destruct method. </p> </blockquote> <p> Hmmm. In another use case I'm using freelist_stack in a special memory pool. The deallocate function is necessary for me as I'm using it from inside of a placement delete operator (the compiler has already called the destructor for me, I only need to give the memory back to the freelist). Would it be possible to leave the deallocate function protected as well, please? </p> <blockquote class="citation"> <p> however in general it would be cleaner to use an api like this: </p> <pre class="wiki">template &lt;class... Args&gt; T * construct(Args&amp;&amp;... args) </pre></blockquote> <p> I agree, except for the use case above, where placement new and delete are used. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>timblechmann</dc:creator> <pubDate>Thu, 22 Nov 2012 11:52:52 GMT</pubDate> <title>status changed; resolution set https://svn.boost.org/trac10/ticket/7321#comment:3 https://svn.boost.org/trac10/ticket/7321#comment:3 <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> Ticket