Boost logo

Boost :

Subject: Re: [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 09:47:08

Le 31/03/12 14:48, Vicente J. Botet Escriba a écrit :
> Le 31/03/12 12:04, Ion Gaztañaga a écrit :
>> El 31/03/2012 11:03, Vicente J. Botet Escriba escribió:
>>> 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;
>> There is no constexpr in Boost.Container code. Current trunk code
>> includes an experimental implementation of scoped_allocator, for
>> C++03 and C++11 compilers.
>>> 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?
>> I don't think Boost.thread should depend on Boost.Container, that's
>> why I've added those classes to boost::container namespace, avoiding
>> any boost:: namespace pollution. The idea is also to define them as
>> std:: typedefs so that a user with a C++11 conforming standard
>> library does not need to add boost::container::xxx overloads. And
>> user C++03 code using boost::xxx types is standard conforming when
>> compiled with C++11 compilers.
> Have you a plan to add these definitions at the boost level?

I'm getting

../../../boost/container/allocator_traits.hpp:170:105: error: type name
requires a specifier or qualifier
          template <typename T> using rebind_alloc =
boost::intrusive::detail::type_rebinder<Alloc, T>::type;

when compiling with clang 3.0 C++11

Adding typename in

       #if !defined(BOOST_NO_TEMPLATE_ALIASES)
          template <typename T> using rebind_alloc = typename
boost::intrusive::detail::type_rebinder<Alloc, T>::type;

Solve the issue.

I have checked it with clang 3.0 (c++11) and gcc-4.7.0 (c++11).

Could you try to fix this?


Boost list run by bdawes at, gregod at, cpdaniel at, john at