This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: [PATCH] C++2a Utility functions to implement uses-allocator construction (P0591R4)
- From: Jonathan Wakely <jwakely at redhat dot com>
- To: libstdc++ at gcc dot gnu dot org, gcc-patches at gcc dot gnu dot org
- Date: Fri, 1 Mar 2019 14:33:06 +0000
- Subject: Re: [PATCH] C++2a Utility functions to implement uses-allocator construction (P0591R4)
- References: <20190301135035.GA15423@redhat.com> <20190301140609.GM8507@redhat.com>
On 01/03/19 14:06 +0000, Jonathan Wakely wrote:
+ if constexpr (sizeof...(__args) == 0)
+ {
+ return std::make_tuple(piecewise_construct,
+ std::__uses_alloc_args<_Tp1>(__a),
+ std::__uses_alloc_args<_Tp2>(__a));
+ }
+ else if constexpr (sizeof...(__args) == 1)
+ {
If we want to ensure we only accept std::pair and not other pair-like
types, then this branch would need:
static_assert((__is_pair<_Args>::value && ...));
+ return std::make_tuple(piecewise_construct,
+ std::__uses_alloc_args<_Tp1>(__a,
+ std::forward<_Args>(__args).first...),
+ std::__uses_alloc_args<_Tp2>(__a,
+ std::forward<_Args>(__args).second...));
+ }
+ else if constexpr (sizeof...(__args) == 2)