Skip to content

Commit

Permalink
Fixes #160 ("Usage of uses_allocator needs a remove_cvref_t")
Browse files Browse the repository at this point in the history
  • Loading branch information
igaztanaga committed Aug 31, 2020
1 parent 1ac7339 commit cdd6d9a
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 8 deletions.
4 changes: 3 additions & 1 deletion doc/container.qbk
Original file line number Diff line number Diff line change
Expand Up @@ -1342,7 +1342,9 @@ use [*Boost.Container]? There are several reasons for that:

* New [classref boost::container::devector devector] container.
* Fixed bugs/issues:
* [@https://github.com/boostorg/container/issues/157 GitHub #157: ['"Add missing include"]].
* [@https://github.com/boostorg/container/pull/157 GitHub #157: ['"Add missing include"]].
* [@https://github.com/boostorg/container/issues/160 GitHub #160: ['"Usage of uses_allocator needs a remove_cvref_t"]].
* [@https://github.com/boostorg/container/issues/161 GitHub #161: ['"polymorphic_allocator(memory_resource*) non-standard extension causes headache"]].

[endsect]

Expand Down
12 changes: 6 additions & 6 deletions include/boost/container/detail/dispatch_uses_allocator.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ template < typename ConstructAlloc
BOOST_CONTAINER_FORCEINLINE typename dtl::enable_if_and
< void
, dtl::is_not_pair<T>
, dtl::not_< uses_allocator<T, ArgAlloc> >
, dtl::not_< uses_allocator<T, typename remove_cvref<ArgAlloc>::type > >
>::type dispatch_uses_allocator
( ConstructAlloc & construct_alloc, BOOST_FWD_REF(ArgAlloc) arg_alloc, T* p, BOOST_FWD_REF(Args)...args)
{
Expand All @@ -130,7 +130,7 @@ template < typename ConstructAlloc
BOOST_CONTAINER_FORCEINLINE typename dtl::enable_if_and
< void
, dtl::is_not_pair<T>
, uses_allocator<T, ArgAlloc>
, uses_allocator<T, typename remove_cvref<ArgAlloc>::type>
, is_constructible_with_allocator_prefix<T, ArgAlloc, Args...>
>::type dispatch_uses_allocator
( ConstructAlloc& construct_alloc, BOOST_FWD_REF(ArgAlloc) arg_alloc, T* p, BOOST_FWD_REF(Args) ...args)
Expand All @@ -149,7 +149,7 @@ template < typename ConstructAlloc
BOOST_CONTAINER_FORCEINLINE typename dtl::enable_if_and
< void
, dtl::is_not_pair<T>
, uses_allocator<T, ArgAlloc>
, uses_allocator<T, typename remove_cvref<ArgAlloc>::type>
, dtl::not_<is_constructible_with_allocator_prefix<T, ArgAlloc, Args...> >
>::type dispatch_uses_allocator
( ConstructAlloc& construct_alloc, BOOST_FWD_REF(ArgAlloc) arg_alloc, T* p, BOOST_FWD_REF(Args)...args)
Expand All @@ -165,7 +165,7 @@ BOOST_CONTAINER_FORCEINLINE typename dtl::enable_if_and
BOOST_CONTAINER_FORCEINLINE typename dtl::enable_if_and\
< void\
, dtl::is_not_pair<T>\
, dtl::not_<uses_allocator<T, ArgAlloc> >\
, dtl::not_<uses_allocator<T, typename remove_cvref<ArgAlloc>::type> >\
>::type\
dispatch_uses_allocator\
(ConstructAlloc &construct_alloc, BOOST_FWD_REF(ArgAlloc) arg_alloc, T* p BOOST_MOVE_I##N BOOST_MOVE_UREF##N)\
Expand All @@ -182,7 +182,7 @@ BOOST_MOVE_ITERATE_0TO9(BOOST_CONTAINER_SCOPED_ALLOCATOR_DISPATCH_USES_ALLOCATOR
BOOST_CONTAINER_FORCEINLINE typename dtl::enable_if_and\
< void\
, dtl::is_not_pair<T>\
, uses_allocator<T, ArgAlloc>\
, uses_allocator<T, typename remove_cvref<ArgAlloc>::type>\
, is_constructible_with_allocator_prefix<T, ArgAlloc BOOST_MOVE_I##N BOOST_MOVE_TARG##N>\
>::type\
dispatch_uses_allocator\
Expand All @@ -200,7 +200,7 @@ BOOST_MOVE_ITERATE_0TO9(BOOST_CONTAINER_SCOPED_ALLOCATOR_DISPATCH_USES_ALLOCATOR
BOOST_CONTAINER_FORCEINLINE typename dtl::enable_if_and\
< void\
, dtl::is_not_pair<T>\
, uses_allocator<T, ArgAlloc>\
, uses_allocator<T, typename remove_cvref<ArgAlloc>::type>\
, dtl::not_<is_constructible_with_allocator_prefix<T, ArgAlloc BOOST_MOVE_I##N BOOST_MOVE_TARG##N> >\
>::type\
dispatch_uses_allocator\
Expand Down
1 change: 1 addition & 0 deletions include/boost/container/detail/type_traits.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ using ::boost::move_detail::add_const;
using ::boost::move_detail::add_const_reference;
using ::boost::move_detail::remove_const;
using ::boost::move_detail::remove_reference;
using ::boost::move_detail::remove_cvref;
using ::boost::move_detail::make_unsigned;
using ::boost::move_detail::is_floating_point;
using ::boost::move_detail::is_integral;
Expand Down
2 changes: 1 addition & 1 deletion test/uses_allocator_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ struct uses_allocator_and_not_convertible_to_int

struct uses_allocator_and_convertible_to_int
{
typedef char allocator_type;
typedef long allocator_type;
};

struct uses_erased_type_allocator
Expand Down

0 comments on commit cdd6d9a

Please sign in to comment.