@@ -141,45 +141,46 @@ class __default_alloc_func;
141141
142142template <class _Fp , class _Ap , class _Rp , class ... _ArgTypes>
143143class __alloc_func <_Fp, _Ap, _Rp(_ArgTypes...)> {
144- __compressed_pair< _Fp, _Ap> __f_ ;
144+ _LIBCPP_COMPRESSED_PAIR ( _Fp, __func_, _Ap, __alloc_) ;
145145
146146public:
147147 typedef _LIBCPP_NODEBUG _Fp _Target;
148148 typedef _LIBCPP_NODEBUG _Ap _Alloc;
149149
150- _LIBCPP_HIDE_FROM_ABI const _Target& __target () const { return __f_. first () ; }
150+ _LIBCPP_HIDE_FROM_ABI const _Target& __target () const { return __func_ ; }
151151
152152 // WIN32 APIs may define __allocator, so use __get_allocator instead.
153- _LIBCPP_HIDE_FROM_ABI const _Alloc& __get_allocator () const { return __f_. second () ; }
153+ _LIBCPP_HIDE_FROM_ABI const _Alloc& __get_allocator () const { return __alloc_ ; }
154154
155- _LIBCPP_HIDE_FROM_ABI explicit __alloc_func (_Target&& __f)
156- : __f_(piecewise_construct, std::forward_as_tuple(std::move(__f)), std::forward_as_tuple()) {}
155+ _LIBCPP_HIDE_FROM_ABI explicit __alloc_func (_Target&& __f) : __func_(std::move(__f)), __alloc_() {}
157156
158- _LIBCPP_HIDE_FROM_ABI explicit __alloc_func (const _Target& __f, const _Alloc& __a)
159- : __f_(piecewise_construct, std::forward_as_tuple(__f), std::forward_as_tuple(__a)) {}
157+ _LIBCPP_HIDE_FROM_ABI explicit __alloc_func (const _Target& __f, const _Alloc& __a) : __func_(__f), __alloc_(__a) {}
160158
161159 _LIBCPP_HIDE_FROM_ABI explicit __alloc_func (const _Target& __f, _Alloc&& __a)
162- : __f_(piecewise_construct, std::forward_as_tuple( __f), std::forward_as_tuple (std::move(__a) )) {}
160+ : __func_( __f), __alloc_ (std::move(__a)) {}
163161
164162 _LIBCPP_HIDE_FROM_ABI explicit __alloc_func (_Target&& __f, _Alloc&& __a)
165- : __f_(piecewise_construct, std::forward_as_tuple(std:: move(__f)), std::forward_as_tuple (std::move(__a) )) {}
163+ : __func_( std::move(__f)), __alloc_ (std::move(__a)) {}
166164
167165 _LIBCPP_HIDE_FROM_ABI _Rp operator ()(_ArgTypes&&... __arg) {
168166 typedef __invoke_void_return_wrapper<_Rp> _Invoker;
169- return _Invoker::__call (__f_. first () , std::forward<_ArgTypes>(__arg)...);
167+ return _Invoker::__call (__func_ , std::forward<_ArgTypes>(__arg)...);
170168 }
171169
172170 _LIBCPP_HIDE_FROM_ABI __alloc_func* __clone () const {
173171 typedef allocator_traits<_Alloc> __alloc_traits;
174172 typedef __rebind_alloc<__alloc_traits, __alloc_func> _AA;
175- _AA __a (__f_. second () );
173+ _AA __a (__alloc_ );
176174 typedef __allocator_destructor<_AA> _Dp;
177175 unique_ptr<__alloc_func, _Dp> __hold (__a.allocate (1 ), _Dp (__a, 1 ));
178- ::new ((void *)__hold.get ()) __alloc_func (__f_. first () , _Alloc (__a));
176+ ::new ((void *)__hold.get ()) __alloc_func (__func_ , _Alloc (__a));
179177 return __hold.release ();
180178 }
181179
182- _LIBCPP_HIDE_FROM_ABI void destroy () _NOEXCEPT { __f_.~__compressed_pair<_Target, _Alloc>(); }
180+ _LIBCPP_HIDE_FROM_ABI void destroy () _NOEXCEPT {
181+ __func_.~_Fp ();
182+ __alloc_.~_Alloc ();
183+ }
183184
184185 _LIBCPP_HIDE_FROM_ABI static void __destroy_and_delete (__alloc_func* __f) {
185186 typedef allocator_traits<_Alloc> __alloc_traits;
0 commit comments