Skip to content

Commit ee24095

Browse files
committed
- Remove fallback_to_dispatch_uses_allocator
- Remove unused arg_alloc arguments
1 parent 97c0a89 commit ee24095

File tree

1 file changed

+14
-57
lines changed

1 file changed

+14
-57
lines changed

include/boost/container/detail/dispatch_uses_allocator.hpp

Lines changed: 14 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -101,9 +101,8 @@ inline typename dtl::enable_if_and
101101
, dtl::is_not_pair<T>
102102
, dtl::not_< uses_allocator<T, typename remove_cvref<ArgAlloc>::type > >
103103
>::type dispatch_uses_allocator
104-
( ConstructAlloc & construct_alloc, BOOST_FWD_REF(ArgAlloc) arg_alloc, T* p, BOOST_FWD_REF(Args)...args)
104+
( ConstructAlloc & construct_alloc, BOOST_FWD_REF(ArgAlloc), T* p, BOOST_FWD_REF(Args)...args)
105105
{
106-
(void)arg_alloc;
107106
allocator_traits<ConstructAlloc>::construct(construct_alloc, p, ::boost::forward<Args>(args)...);
108107
}
109108

@@ -156,7 +155,7 @@ inline typename dtl::enable_if_and
156155

157156
/////////////////////////////////////////////////////////////////////////
158157
//
159-
// fallback_to_dispatch_uses_allocator (original args constructible)
158+
// dispatch_uses_allocator (NOT pair, uses-allocator no viable constructor)
160159
//
161160
/////////////////////////////////////////////////////////////////////////
162161
template < typename ConstructAlloc
@@ -167,34 +166,15 @@ template < typename ConstructAlloc
167166
inline typename dtl::enable_if_and
168167
< void
169168
, dtl::is_not_pair<T>
170-
, is_constructible<T, Args...>
171-
>::type fallback_to_dispatch_uses_allocator
172-
( ConstructAlloc & construct_alloc, BOOST_FWD_REF(ArgAlloc) arg_alloc, T* p, BOOST_FWD_REF(Args)...args)
169+
, uses_allocator<T, typename remove_cvref<ArgAlloc>::type>
170+
, dtl::not_<is_constructible_with_allocator_prefix<T, ArgAlloc, Args...> >
171+
, dtl::not_<is_constructible_with_allocator_suffix<T, ArgAlloc, Args...> >
172+
>::type dispatch_uses_allocator
173+
( ConstructAlloc& construct_alloc, BOOST_FWD_REF(ArgAlloc), T* p, BOOST_FWD_REF(Args)...args)
173174
{
174-
(void)arg_alloc;
175175
allocator_traits<ConstructAlloc>::construct(construct_alloc, p, ::boost::forward<Args>(args)...);
176176
}
177177

178-
/////////////////////////////////////////////////////////////////////////
179-
//
180-
// fallback_to_dispatch_uses_allocator (original args NOT constructible)
181-
//
182-
/////////////////////////////////////////////////////////////////////////
183-
template < typename ConstructAlloc
184-
, typename ArgAlloc
185-
, typename T
186-
, class ...Args
187-
>
188-
inline typename dtl::enable_if_and
189-
< void
190-
, dtl::is_not_pair<T>
191-
, dtl::not_<is_constructible<T, Args...> >
192-
>::type fallback_to_dispatch_uses_allocator
193-
( ConstructAlloc & construct_alloc, BOOST_FWD_REF(ArgAlloc) arg_alloc, T* p, BOOST_FWD_REF(Args)...args)
194-
{
195-
(dispatch_uses_allocator)(construct_alloc, ::boost::forward<ArgAlloc>(arg_alloc), p, ::boost::forward<Args>(args)...);
196-
}
197-
198178
#else //#if !defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES)
199179

200180
/////////////////////////////////////////////////////////////////////////
@@ -210,9 +190,8 @@ inline typename dtl::enable_if_and
210190
, dtl::not_<uses_allocator<T, typename remove_cvref<ArgAlloc>::type> >\
211191
>::type\
212192
dispatch_uses_allocator\
213-
(ConstructAlloc &construct_alloc, BOOST_FWD_REF(ArgAlloc) arg_alloc, T* p BOOST_MOVE_I##N BOOST_MOVE_UREF##N)\
193+
(ConstructAlloc &construct_alloc, BOOST_FWD_REF(ArgAlloc), T* p BOOST_MOVE_I##N BOOST_MOVE_UREF##N)\
214194
{\
215-
(void)arg_alloc;\
216195
allocator_traits<ConstructAlloc>::construct(construct_alloc, p BOOST_MOVE_I##N BOOST_MOVE_FWD##N);\
217196
}\
218197
//
@@ -268,49 +247,27 @@ BOOST_MOVE_ITERATE_0TO9(BOOST_CONTAINER_SCOPED_ALLOCATOR_DISPATCH_USES_ALLOCATOR
268247

269248
/////////////////////////////////////////////////////////////////////////
270249
//
271-
// fallback_to_dispatch_uses_allocator (original args constructible)
250+
// dispatch_uses_allocator (NOT pair, uses-allocator no viable constructor)
272251
//
273252
/////////////////////////////////////////////////////////////////////////
274253
#define BOOST_CONTAINER_SCOPED_ALLOCATOR_DISPATCH_USES_ALLOCATOR_CODE(N) \
275254
template < typename ConstructAlloc, typename ArgAlloc, typename T BOOST_MOVE_I##N BOOST_MOVE_CLASS##N >\
276255
inline typename dtl::enable_if_and\
277256
< void\
278257
, dtl::is_not_pair<T>\
279-
, is_constructible<T BOOST_MOVE_I##N BOOST_MOVE_TARG##N>\
258+
, uses_allocator<T, typename remove_cvref<ArgAlloc>::type>\
259+
, dtl::not_<is_constructible_with_allocator_prefix<T, ArgAlloc BOOST_MOVE_I##N BOOST_MOVE_TARG##N> >\
260+
, dtl::not_<is_constructible_with_allocator_suffix<T, ArgAlloc BOOST_MOVE_I##N BOOST_MOVE_TARG##N> >\
280261
>::type\
281-
fallback_to_dispatch_uses_allocator\
282-
(ConstructAlloc& construct_alloc, BOOST_FWD_REF(ArgAlloc) arg_alloc, T* p BOOST_MOVE_I##N BOOST_MOVE_UREF##N)\
262+
dispatch_uses_allocator\
263+
(ConstructAlloc& construct_alloc, BOOST_FWD_REF(ArgAlloc), T* p BOOST_MOVE_I##N BOOST_MOVE_UREF##N)\
283264
{\
284-
(void)arg_alloc;\
285265
allocator_traits<ConstructAlloc>::construct(construct_alloc, p BOOST_MOVE_I##N BOOST_MOVE_FWD##N);\
286266
}\
287267
//
288268
BOOST_MOVE_ITERATE_0TO9(BOOST_CONTAINER_SCOPED_ALLOCATOR_DISPATCH_USES_ALLOCATOR_CODE)
289269
#undef BOOST_CONTAINER_SCOPED_ALLOCATOR_DISPATCH_USES_ALLOCATOR_CODE
290270

291-
292-
/////////////////////////////////////////////////////////////////////////
293-
//
294-
// fallback_to_dispatch_uses_allocator (original args NOT constructible)
295-
//
296-
/////////////////////////////////////////////////////////////////////////
297-
#define BOOST_CONTAINER_SCOPED_ALLOCATOR_DISPATCH_USES_ALLOCATOR_CODE(N) \
298-
template < typename ConstructAlloc, typename ArgAlloc, typename T BOOST_MOVE_I##N BOOST_MOVE_CLASS##N >\
299-
inline typename dtl::enable_if_and\
300-
< void\
301-
, dtl::is_not_pair<T>\
302-
, dtl::not_<is_constructible<T BOOST_MOVE_I##N BOOST_MOVE_TARG##N> >\
303-
>::type\
304-
fallback_to_dispatch_uses_allocator\
305-
(ConstructAlloc& construct_alloc, BOOST_FWD_REF(ArgAlloc) arg_alloc, T* p BOOST_MOVE_I##N BOOST_MOVE_UREF##N)\
306-
{\
307-
(dispatch_uses_allocator)(construct_alloc, ::boost::forward<ArgAlloc>(arg_alloc), p BOOST_MOVE_I##N BOOST_MOVE_FWD##N);\
308-
}\
309-
//
310-
BOOST_MOVE_ITERATE_0TO9(BOOST_CONTAINER_SCOPED_ALLOCATOR_DISPATCH_USES_ALLOCATOR_CODE)
311-
#undef BOOST_CONTAINER_SCOPED_ALLOCATOR_DISPATCH_USES_ALLOCATOR_CODE
312-
313-
314271
#endif //#if !defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES)
315272

316273
template < typename ConstructAlloc

0 commit comments

Comments
 (0)