Re: [Boost-bugs] [Boost C++ Libraries] #7321: freelist_stack::allocate and freelist_stack::deallocate should not be private

Subject: Re: [Boost-bugs] [Boost C++ Libraries] #7321: freelist_stack::allocate and freelist_stack::deallocate should not be private
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2012-09-03 12:55:36


#7321: freelist_stack::allocate and freelist_stack::deallocate should not be
private
-------------------------------+--------------------------------------------
  Reporter: hkaiser | Owner: timblechmann
      Type: Bugs | Status: new
 Milestone: To Be Determined | Component: lockfree
   Version: Boost 1.52.0 | Severity: Problem
Resolution: | Keywords:
-------------------------------+--------------------------------------------

Comment (by hkaiser):

 Replying to [comment:1 timblechmann]:
> making allocate protected. deallocate should not be required, as one can
 still use the destruct method.

 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?

> however in general it would be cleaner to use an api like this:
> {{{
> template <class... Args>
> T * construct(Args&&... args)
> }}}

 I agree, except for the use case above, where placement new and delete are
 used.

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/7321#comment:2>
Boost C++ Libraries <http://www.boost.org/>
Boost provides free peer-reviewed portable C++ source libraries.

This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:10 UTC