182 typedef __inner_type_impl<_OuterAlloc, _InnerAllocs...> __inner_type;
183 __inner_type _M_inner;
185 template<
typename _Outer,
typename... _Inner>
188 template<
typename...>
189 friend struct __inner_type_impl;
191 tuple<
const _OuterAlloc&,
const _InnerAllocs&...>
192 _M_tie()
const noexcept
195 template<
typename _Alloc>
199#if ! __glibcxx_make_obj_using_allocator
200 template<
typename _Tp,
typename... _Args>
202 _M_construct(__uses_alloc0, _Tp* __p, _Args&&... __args)
205 _O_traits::construct(__outermost(*
this), __p,
206 std::forward<_Args>(__args)...);
209 typedef __uses_alloc1<typename __inner_type::__type> __uses_alloc1_;
210 typedef __uses_alloc2<typename __inner_type::__type> __uses_alloc2_;
212 template<
typename _Tp,
typename... _Args>
214 _M_construct(__uses_alloc1_, _Tp* __p, _Args&&... __args)
217 _O_traits::construct(__outermost(*
this), __p,
218 allocator_arg, inner_allocator(),
219 std::forward<_Args>(__args)...);
222 template<
typename _Tp,
typename... _Args>
224 _M_construct(__uses_alloc2_, _Tp* __p, _Args&&... __args)
227 _O_traits::construct(__outermost(*
this), __p,
228 std::forward<_Args>(__args)...,
233 template<
typename _Alloc>
235 _S_select_on_copy(
const _Alloc& __a)
238 return __a_traits::select_on_container_copy_construction(__a);
241 template<std::size_t... _Indices>
243 const _InnerAllocs&...> __refs,
244 _Index_tuple<_Indices...>)
245 : _OuterAlloc(_S_select_on_copy(std::get<0>(__refs))),
246 _M_inner(_S_select_on_copy(std::get<_Indices+1>(__refs))...)
250 template<
typename _Alloc>
251 using _Constructible =
typename enable_if<
257 template<
typename _Tp>
258 struct __not_pair {
using type = void; };
260 template<
typename _Tp,
typename _Up>
261 struct __not_pair<
pair<_Tp, _Up>> { };
264 typedef _OuterAlloc outer_allocator_type;
265 typedef typename __inner_type::__type inner_allocator_type;
275 typedef typename __or_<
278 propagate_on_container_copy_assignment...>::type
279 propagate_on_container_copy_assignment;
281 typedef typename __or_<
284 propagate_on_container_move_assignment...>::type
285 propagate_on_container_move_assignment;
287 typedef typename __or_<
290 propagate_on_container_swap...>::type
291 propagate_on_container_swap;
293 typedef typename __and_<
302 typename __traits::template rebind_alloc<_Tp>,
303 _InnerAllocs...> other;
308 template<
typename _Outer2,
typename = _Constructible<_Outer2>>
310 const _InnerAllocs&... __inner) noexcept
311 : _OuterAlloc(std::forward<_Outer2>(__outer)),
316 : _OuterAlloc(__other.outer_allocator()),
317 _M_inner(__other._M_inner)
321 : _OuterAlloc(
std::move(__other.outer_allocator())),
325 template<
typename _Outer2,
typename = _Constructible<const _Outer2&>>
329 : _OuterAlloc(__other.outer_allocator()),
330 _M_inner(__other._M_inner)
333 template<
typename _Outer2,
typename = _Constructible<_Outer2>>
336 : _OuterAlloc(
std::move(__other.outer_allocator())),
346 inner_allocator_type&
347 inner_allocator()
noexcept
348 {
return _M_inner._M_get(
this); }
350 const inner_allocator_type&
351 inner_allocator()
const noexcept
352 {
return _M_inner._M_get(
this); }
354 outer_allocator_type&
355 outer_allocator()
noexcept
356 {
return static_cast<_OuterAlloc&
>(*this); }
358 const outer_allocator_type&
359 outer_allocator()
const noexcept
360 {
return static_cast<const _OuterAlloc&
>(*this); }
362 _GLIBCXX_NODISCARD pointer
363 allocate(size_type __n)
366 _GLIBCXX_NODISCARD pointer
367 allocate(size_type __n, const_void_pointer __hint)
370 void deallocate(pointer __p, size_type __n)
noexcept
373 size_type max_size()
const
376#if ! __glibcxx_make_obj_using_allocator
377 template<
typename _Tp,
typename... _Args>
378 typename __not_pair<_Tp>::type
379 construct(_Tp* __p, _Args&&... __args)
381 auto& __inner = inner_allocator();
383 = std::__use_alloc<_Tp, inner_allocator_type, _Args...>(__inner);
384 _M_construct(__use_tag, __p, std::forward<_Args>(__args)...);
387 template<
typename _T1,
typename _T2,
typename... _Args1,
395 auto& __inner = inner_allocator();
397 = std::__use_alloc<_T1, inner_allocator_type, _Args1...>(__inner);
399 = std::__use_alloc<_T2, inner_allocator_type, _Args2...>(__inner);
400 typename _Build_index_tuple<
sizeof...(_Args1)>::__type __x_indices;
401 typename _Build_index_tuple<
sizeof...(_Args2)>::__type __y_indices;
404 _M_construct_p(__x_use_tag, __x_indices, __x),
405 _M_construct_p(__y_use_tag, __y_indices, __y));
408 template<
typename _T1,
typename _T2>
413 template<
typename _T1,
typename _T2,
typename _Up,
typename _Vp>
422 template<
typename _T1,
typename _T2,
typename _Up,
typename _Vp>
431 template<
typename _T1,
typename _T2,
typename _Up,
typename _Vp>
440 template<
typename _Tp,
typename... _Args>
441 __attribute__((__nonnull__))
443 construct(_Tp* __p, _Args&&... __args)
446 std::apply([__p,
this](
auto&&... __newargs) {
447 _O_traits::construct(__outermost(*
this), __p,
450 uses_allocator_construction_args<_Tp>(inner_allocator(),
451 std::forward<_Args>(__args)...));
455 template<
typename _Tp>
456 void destroy(_Tp* __p)
459 _O_traits::destroy(__outermost(*
this), __p);
463 select_on_container_copy_construction()
const
465 typedef typename _Build_index_tuple<
sizeof...(_InnerAllocs)>::__type
470 template <
typename _OutA1,
typename _OutA2,
typename... _InA>
476#if ! __glibcxx_make_obj_using_allocator
477 template<
typename _Ind,
typename... _Args>
482 template<
size_t... _Ind,
typename... _Args>
483 tuple<allocator_arg_t, inner_allocator_type&, _Args&&...>
484 _M_construct_p(__uses_alloc1_, _Index_tuple<_Ind...>,
487 return { allocator_arg, inner_allocator(),
492 template<
size_t... _Ind,
typename... _Args>
493 tuple<_Args&&..., inner_allocator_type&>
494 _M_construct_p(__uses_alloc2_, _Index_tuple<_Ind...>,
497 return { std::get<_Ind>(
std::move(__t))..., inner_allocator() };