Boost logo

Boost :

Subject: [boost] [container][memory] Request to move allocator_arg_t and uses_allocator to a memory related file.
From: Vicente J. Botet Escriba (vicente.botet_at_[hidden])
Date: 2012-03-31 05:03:26


Hi,

I want to add Allocators to the packaged_task and promise class of
Boost.Thread

     template <class Allocator>
         promise(allocator_arg_t, const Allocator& a);

     template <class F, class Allocator>
         explicit packaged_task(allocator_arg_t, const Allocator& a, F&& f);

I see that Boost.Container has already defined in namespace
boost::container and in file boost/container/scoped_allocator.hpp the
following

struct allocator_arg_t { };
constexpr allocator_arg_t allocator_arg = allocator_arg_t();

template <class T, class Alloc> struct uses_allocator;

I would like to shared these to all the Boost libraries. I don't think
it is a good idea to make Boost.Thread depend on Boost.Container just
for this. Could these declarations be included in a specific file? These
declaration are included in <memory> in the C++11. What would be the
best library to contain these declarations?

What about a new boost/memory.hpp file?
What about moving them to the boost or boost::memory namespace?

Best,
Vicente


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk