Please use GitHub pull requests for new patches. Phabricator shutdown timeline
Changeset View
Changeset View
Standalone View
Standalone View
include/scoped_allocator
Show First 20 Lines • Show All 490 Lines • ▼ Show 20 Lines | void deallocate(pointer __p, size_type __n) _NOEXCEPT | ||||
{allocator_traits<outer_allocator_type>:: | {allocator_traits<outer_allocator_type>:: | ||||
deallocate(outer_allocator(), __p, __n);} | deallocate(outer_allocator(), __p, __n);} | ||||
_LIBCPP_INLINE_VISIBILITY | _LIBCPP_INLINE_VISIBILITY | ||||
size_type max_size() const | size_type max_size() const | ||||
{return allocator_traits<outer_allocator_type>::max_size(outer_allocator());} | {return allocator_traits<outer_allocator_type>::max_size(outer_allocator());} | ||||
template <class _Tp, class... _Args> | template <class _Tp, class... _Args> | ||||
_LIBCPP_INLINE_VISIBILITY | _LIBCPP_INLINE_VISIBILITY | ||||
void construct(_Tp* __p, _Args&& ...__args) | void construct(_Tp* __p, _Args&& ...__args) | ||||
{__construct(__uses_alloc_ctor<_Tp, inner_allocator_type&, _Args...>(), | { | ||||
__p, _VSTD::forward<_Args>(__args)...);} | #if _LIBCPP_STD_VER > 17 | ||||
using _OM = __outermost<outer_allocator_type>; | |||||
_VSTD::apply([__p, this](auto&&... __alloc_args) { | |||||
allocator_traits<typename _OM::type>::construct( | |||||
_OM()(*this), __p, | |||||
_VSTD::forward<decltype(__alloc_args)>(__alloc_args)...); | |||||
}, _VSTD::uses_allocator_construction_args<_Tp>(inner_allocator(), | |||||
_VSTD::forward<_Args>(__args)...)); | |||||
#else | |||||
__construct(__uses_alloc_ctor<_Tp, inner_allocator_type&, _Args...>(), | |||||
__p, _VSTD::forward<_Args>(__args)...); | |||||
#endif // _LIBCPP_STD_VER > 17 | |||||
Quuxplusone: This function body is indented an extra level. Not your patch's fault, but I wonder if your… | |||||
Yep, good catch. I can fix that. zoecarver: Yep, good catch. I can fix that. | |||||
} | |||||
#if _LIBCPP_STD_VER <= 17 | |||||
template <class _T1, class _T2, class... _Args1, class... _Args2> | template <class _T1, class _T2, class... _Args1, class... _Args2> | ||||
void construct(pair<_T1, _T2>* __p, piecewise_construct_t, | void construct(pair<_T1, _T2>* __p, piecewise_construct_t, | ||||
tuple<_Args1...> __x, tuple<_Args2...> __y) | tuple<_Args1...> __x, tuple<_Args2...> __y) | ||||
{ | { | ||||
typedef __outermost<outer_allocator_type> _OM; | typedef __outermost<outer_allocator_type> _OM; | ||||
allocator_traits<typename _OM::type>::construct( | allocator_traits<typename _OM::type>::construct( | ||||
_OM()(outer_allocator()), __p, piecewise_construct | _OM()(outer_allocator()), __p, piecewise_construct | ||||
, __transform_tuple( | , __transform_tuple( | ||||
Show All 32 Lines | #if _LIBCPP_STD_VER <= 17 | ||||
} | } | ||||
template <class _T1, class _T2, class _Up, class _Vp> | template <class _T1, class _T2, class _Up, class _Vp> | ||||
void construct(pair<_T1, _T2>* __p, pair<_Up, _Vp>&& __x) { | void construct(pair<_T1, _T2>* __p, pair<_Up, _Vp>&& __x) { | ||||
construct(__p, piecewise_construct, | construct(__p, piecewise_construct, | ||||
_VSTD::forward_as_tuple(_VSTD::forward<_Up>(__x.first)), | _VSTD::forward_as_tuple(_VSTD::forward<_Up>(__x.first)), | ||||
_VSTD::forward_as_tuple(_VSTD::forward<_Vp>(__x.second))); | _VSTD::forward_as_tuple(_VSTD::forward<_Vp>(__x.second))); | ||||
} | } | ||||
#endif // _LIBCPP_STD_VER <= 17 | |||||
template <class _Tp> | template <class _Tp> | ||||
_LIBCPP_INLINE_VISIBILITY | _LIBCPP_INLINE_VISIBILITY | ||||
void destroy(_Tp* __p) | void destroy(_Tp* __p) | ||||
{ | { | ||||
typedef __outermost<outer_allocator_type> _OM; | typedef __outermost<outer_allocator_type> _OM; | ||||
allocator_traits<typename _OM::type>:: | allocator_traits<typename _OM::type>:: | ||||
destroy(_OM()(outer_allocator()), __p); | destroy(_OM()(outer_allocator()), __p); | ||||
▲ Show 20 Lines • Show All 124 Lines • Show Last 20 Lines |
This function body is indented an extra level. Not your patch's fault, but I wonder if your patch should fix it.