
AMDG Christian Schladetsch wrote:
https://svn.boost.org/svn/boost/sandbox/monotonic/boost/monotonic/region_all.... The nterface is:
/// a monotonic region allocator uses a specified storage. /// Each region uses independent /// storage that may be used and reset. template <class T, size_t Region = 0> struct region_allocator;
This is used like:
typedef std::list<int, monotonic::region_allocator<int, 0> > List; typedef std::list<int, monotonic::region_allocator<int, 42> > OtherList; // .... monotonic::reset_region<42>();
etc. Basically, it allows you to have up to monotonic::DefaultSizes::MaxRegions of independantly controlled regions of storage.
Why do you need an integer? Can't you use a tag class? template<class T, class Tag = void> struct allocator; typedef std::list<int, monotonic::allocator<int, struct tag1> > List; In Christ, Steven Watanabe