From af06acfc8de1ddcfd02a4de1200735b5479f086f Mon Sep 17 00:00:00 2001 From: Jonathan Wakely Date: Wed, 26 Aug 2020 19:32:30 +0100 Subject: [PATCH] libstdc++: Whitespace changes in libstdc++-v3/ChangeLog: * include/std/tuple (_Tuple_impl): Whitespaces changes for consistent indentation. Also use __enable_if_t alias template. --- libstdc++-v3/include/std/tuple | 162 +++++++++++++++++++-------------- 1 file changed, 94 insertions(+), 68 deletions(-) diff --git a/libstdc++-v3/include/std/tuple b/libstdc++-v3/include/std/tuple index 7be9943e34a..1c22d4db788 100644 --- a/libstdc++-v3/include/std/tuple +++ b/libstdc++-v3/include/std/tuple @@ -265,16 +265,18 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION constexpr _Tuple_impl() : _Inherited(), _Base() { } - explicit - constexpr _Tuple_impl(const _Head& __head, const _Tail&... __tail) - : _Inherited(__tail...), _Base(__head) { } - - template::type> - explicit - constexpr _Tuple_impl(_UHead&& __head, _UTail&&... __tail) + explicit constexpr + _Tuple_impl(const _Head& __head, const _Tail&... __tail) + : _Inherited(__tail...), _Base(__head) + { } + + template> + explicit constexpr + _Tuple_impl(_UHead&& __head, _UTail&&... __tail) : _Inherited(std::forward<_UTail>(__tail)...), - _Base(std::forward<_UHead>(__head)) { } + _Base(std::forward<_UHead>(__head)) + { } constexpr _Tuple_impl(const _Tuple_impl&) = default; @@ -285,58 +287,67 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION constexpr _Tuple_impl(_Tuple_impl&& __in) noexcept(__and_, - is_nothrow_move_constructible<_Inherited>>::value) + is_nothrow_move_constructible<_Inherited>>::value) : _Inherited(std::move(_M_tail(__in))), - _Base(std::forward<_Head>(_M_head(__in))) { } + _Base(std::forward<_Head>(_M_head(__in))) + { } template - constexpr _Tuple_impl(const _Tuple_impl<_Idx, _UElements...>& __in) + constexpr + _Tuple_impl(const _Tuple_impl<_Idx, _UElements...>& __in) : _Inherited(_Tuple_impl<_Idx, _UElements...>::_M_tail(__in)), - _Base(_Tuple_impl<_Idx, _UElements...>::_M_head(__in)) { } + _Base(_Tuple_impl<_Idx, _UElements...>::_M_head(__in)) + { } template - constexpr _Tuple_impl(_Tuple_impl<_Idx, _UHead, _UTails...>&& __in) + constexpr + _Tuple_impl(_Tuple_impl<_Idx, _UHead, _UTails...>&& __in) : _Inherited(std::move (_Tuple_impl<_Idx, _UHead, _UTails...>::_M_tail(__in))), _Base(std::forward<_UHead> - (_Tuple_impl<_Idx, _UHead, _UTails...>::_M_head(__in))) { } + (_Tuple_impl<_Idx, _UHead, _UTails...>::_M_head(__in))) + { } template _GLIBCXX20_CONSTEXPR _Tuple_impl(allocator_arg_t __tag, const _Alloc& __a) : _Inherited(__tag, __a), - _Base(__tag, __use_alloc<_Head>(__a)) { } + _Base(__tag, __use_alloc<_Head>(__a)) + { } template _Tuple_impl(allocator_arg_t __tag, const _Alloc& __a, const _Head& __head, const _Tail&... __tail) : _Inherited(__tag, __a, __tail...), - _Base(__use_alloc<_Head, _Alloc, _Head>(__a), __head) { } + _Base(__use_alloc<_Head, _Alloc, _Head>(__a), __head) + { } template::type> + typename = __enable_if_t> _GLIBCXX20_CONSTEXPR _Tuple_impl(allocator_arg_t __tag, const _Alloc& __a, - _UHead&& __head, _UTail&&... __tail) + _UHead&& __head, _UTail&&... __tail) : _Inherited(__tag, __a, std::forward<_UTail>(__tail)...), - _Base(__use_alloc<_Head, _Alloc, _UHead>(__a), - std::forward<_UHead>(__head)) { } + _Base(__use_alloc<_Head, _Alloc, _UHead>(__a), + std::forward<_UHead>(__head)) + { } template _GLIBCXX20_CONSTEXPR - _Tuple_impl(allocator_arg_t __tag, const _Alloc& __a, - const _Tuple_impl& __in) + _Tuple_impl(allocator_arg_t __tag, const _Alloc& __a, + const _Tuple_impl& __in) : _Inherited(__tag, __a, _M_tail(__in)), - _Base(__use_alloc<_Head, _Alloc, _Head>(__a), _M_head(__in)) { } + _Base(__use_alloc<_Head, _Alloc, _Head>(__a), _M_head(__in)) + { } template _GLIBCXX20_CONSTEXPR _Tuple_impl(allocator_arg_t __tag, const _Alloc& __a, - _Tuple_impl&& __in) + _Tuple_impl&& __in) : _Inherited(__tag, __a, std::move(_M_tail(__in))), _Base(__use_alloc<_Head, _Alloc, _Head>(__a), - std::forward<_Head>(_M_head(__in))) { } + std::forward<_Head>(_M_head(__in))) + { } template _GLIBCXX20_CONSTEXPR @@ -345,23 +356,25 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION : _Inherited(__tag, __a, _Tuple_impl<_Idx, _UHead, _UTails...>::_M_tail(__in)), _Base(__use_alloc<_Head, _Alloc, _UHead>(__a), - _Tuple_impl<_Idx, _UHead, _UTails...>::_M_head(__in)) { } + _Tuple_impl<_Idx, _UHead, _UTails...>::_M_head(__in)) + { } template _GLIBCXX20_CONSTEXPR _Tuple_impl(allocator_arg_t __tag, const _Alloc& __a, - _Tuple_impl<_Idx, _UHead, _UTails...>&& __in) + _Tuple_impl<_Idx, _UHead, _UTails...>&& __in) : _Inherited(__tag, __a, std::move (_Tuple_impl<_Idx, _UHead, _UTails...>::_M_tail(__in))), _Base(__use_alloc<_Head, _Alloc, _UHead>(__a), - std::forward<_UHead> - (_Tuple_impl<_Idx, _UHead, _UTails...>::_M_head(__in))) { } + std::forward<_UHead> + (_Tuple_impl<_Idx, _UHead, _UTails...>::_M_head(__in))) + { } template _GLIBCXX20_CONSTEXPR - void - _M_assign(const _Tuple_impl<_Idx, _UElements...>& __in) - { + void + _M_assign(const _Tuple_impl<_Idx, _UElements...>& __in) + { _M_head(*this) = _Tuple_impl<_Idx, _UElements...>::_M_head(__in); _M_tail(*this)._M_assign( _Tuple_impl<_Idx, _UElements...>::_M_tail(__in)); @@ -369,9 +382,9 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION template _GLIBCXX20_CONSTEXPR - void - _M_assign(_Tuple_impl<_Idx, _UHead, _UTails...>&& __in) - { + void + _M_assign(_Tuple_impl<_Idx, _UHead, _UTails...>&& __in) + { _M_head(*this) = std::forward<_UHead> (_Tuple_impl<_Idx, _UHead, _UTails...>::_M_head(__in)); _M_tail(*this)._M_assign( @@ -404,17 +417,20 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION static constexpr const _Head& _M_head(const _Tuple_impl& __t) noexcept { return _Base::_M_head(__t); } - constexpr _Tuple_impl() + constexpr + _Tuple_impl() : _Base() { } - explicit - constexpr _Tuple_impl(const _Head& __head) - : _Base(__head) { } + explicit constexpr + _Tuple_impl(const _Head& __head) + : _Base(__head) + { } template - explicit - constexpr _Tuple_impl(_UHead&& __head) - : _Base(std::forward<_UHead>(__head)) { } + explicit constexpr + _Tuple_impl(_UHead&& __head) + : _Base(std::forward<_UHead>(__head)) + { } constexpr _Tuple_impl(const _Tuple_impl&) = default; @@ -425,75 +441,85 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION constexpr _Tuple_impl(_Tuple_impl&& __in) noexcept(is_nothrow_move_constructible<_Head>::value) - : _Base(std::forward<_Head>(_M_head(__in))) { } + : _Base(std::forward<_Head>(_M_head(__in))) + { } template - constexpr _Tuple_impl(const _Tuple_impl<_Idx, _UHead>& __in) - : _Base(_Tuple_impl<_Idx, _UHead>::_M_head(__in)) { } + constexpr + _Tuple_impl(const _Tuple_impl<_Idx, _UHead>& __in) + : _Base(_Tuple_impl<_Idx, _UHead>::_M_head(__in)) + { } template - constexpr _Tuple_impl(_Tuple_impl<_Idx, _UHead>&& __in) + constexpr + _Tuple_impl(_Tuple_impl<_Idx, _UHead>&& __in) : _Base(std::forward<_UHead>(_Tuple_impl<_Idx, _UHead>::_M_head(__in))) { } template _GLIBCXX20_CONSTEXPR _Tuple_impl(allocator_arg_t __tag, const _Alloc& __a) - : _Base(__tag, __use_alloc<_Head>(__a)) { } + : _Base(__tag, __use_alloc<_Head>(__a)) + { } template _Tuple_impl(allocator_arg_t __tag, const _Alloc& __a, const _Head& __head) - : _Base(__use_alloc<_Head, _Alloc, _Head>(__a), __head) { } + : _Base(__use_alloc<_Head, _Alloc, const _Head&>(__a), __head) + { } template _GLIBCXX20_CONSTEXPR _Tuple_impl(allocator_arg_t __tag, const _Alloc& __a, - _UHead&& __head) + _UHead&& __head) : _Base(__use_alloc<_Head, _Alloc, _UHead>(__a), - std::forward<_UHead>(__head)) { } + std::forward<_UHead>(__head)) + { } template _GLIBCXX20_CONSTEXPR - _Tuple_impl(allocator_arg_t __tag, const _Alloc& __a, - const _Tuple_impl& __in) - : _Base(__use_alloc<_Head, _Alloc, _Head>(__a), _M_head(__in)) { } + _Tuple_impl(allocator_arg_t __tag, const _Alloc& __a, + const _Tuple_impl& __in) + : _Base(__use_alloc<_Head, _Alloc, const _Head&>(__a), _M_head(__in)) + { } template _GLIBCXX20_CONSTEXPR _Tuple_impl(allocator_arg_t __tag, const _Alloc& __a, - _Tuple_impl&& __in) + _Tuple_impl&& __in) : _Base(__use_alloc<_Head, _Alloc, _Head>(__a), - std::forward<_Head>(_M_head(__in))) { } + std::forward<_Head>(_M_head(__in))) + { } template _GLIBCXX20_CONSTEXPR _Tuple_impl(allocator_arg_t __tag, const _Alloc& __a, - const _Tuple_impl<_Idx, _UHead>& __in) - : _Base(__use_alloc<_Head, _Alloc, _Head>(__a), - _Tuple_impl<_Idx, _UHead>::_M_head(__in)) { } + const _Tuple_impl<_Idx, _UHead>& __in) + : _Base(__use_alloc<_Head, _Alloc, const _UHead&>(__a), + _Tuple_impl<_Idx, _UHead>::_M_head(__in)) + { } template _GLIBCXX20_CONSTEXPR _Tuple_impl(allocator_arg_t __tag, const _Alloc& __a, - _Tuple_impl<_Idx, _UHead>&& __in) + _Tuple_impl<_Idx, _UHead>&& __in) : _Base(__use_alloc<_Head, _Alloc, _UHead>(__a), - std::forward<_UHead>(_Tuple_impl<_Idx, _UHead>::_M_head(__in))) + std::forward<_UHead>(_Tuple_impl<_Idx, _UHead>::_M_head(__in))) { } template _GLIBCXX20_CONSTEXPR - void - _M_assign(const _Tuple_impl<_Idx, _UHead>& __in) - { + void + _M_assign(const _Tuple_impl<_Idx, _UHead>& __in) + { _M_head(*this) = _Tuple_impl<_Idx, _UHead>::_M_head(__in); } template _GLIBCXX20_CONSTEXPR - void - _M_assign(_Tuple_impl<_Idx, _UHead>&& __in) - { + void + _M_assign(_Tuple_impl<_Idx, _UHead>&& __in) + { _M_head(*this) = std::forward<_UHead>(_Tuple_impl<_Idx, _UHead>::_M_head(__in)); } -- 2.30.2