diff options
Diffstat (limited to 'src/DI/compressed_pair.hpp')
-rw-r--r-- | src/DI/compressed_pair.hpp | 42 |
1 files changed, 27 insertions, 15 deletions
diff --git a/src/DI/compressed_pair.hpp b/src/DI/compressed_pair.hpp index 6e05e29..b8646db 100644 --- a/src/DI/compressed_pair.hpp +++ b/src/DI/compressed_pair.hpp @@ -33,8 +33,8 @@ struct IntegerSequence template <size_t SizeOne, size_t SizeTwo> using MakeIndices = - typename __make_integer_seq<IntegerSequence, size_t, - SizeOne - SizeTwo>::template ToTupleIndices<SizeTwo>; + typename __make_integer_seq<IntegerSequence, size_t, SizeOne - SizeTwo>:: + template ToTupleIndices<SizeTwo>; template <size_t SizeOne, size_t SizeTwo = 0> requires(SizeTwo <= SizeOne) struct MakeTupleIndices @@ -64,9 +64,11 @@ struct CompressedPairElement } template <class... Args, size_t... Indexes> - constexpr CompressedPairElement(std::piecewise_construct_t /*unused*/, - std::tuple<Args...> args, - TupleIndices<Indexes...> /*unused*/) + constexpr CompressedPairElement( + std::piecewise_construct_t /*unused*/, + std::tuple<Args...> args, + TupleIndices<Indexes...> /*unused*/ + ) : _value(std::forward<Args>(std::get<Indexes>(args))...) { } @@ -107,9 +109,11 @@ struct CompressedPairElement<Value, Idx> : private Value } template <class... Args, size_t... Indexes> - constexpr CompressedPairElement(std::piecewise_construct_t /*unused*/, - std::tuple<Args...> args, - TupleIndices<Indexes...> /*unused*/) + constexpr CompressedPairElement( + std::piecewise_construct_t /*unused*/, + std::tuple<Args...> args, + TupleIndices<Indexes...> /*unused*/ + ) : Value(std::forward<Args>(std::get<Indexes>(args))...) { } @@ -146,13 +150,21 @@ public: } template <class... ArgsOne, class... ArgsTwo> - constexpr CompressedPair(std::piecewise_construct_t piecewise_construct, - std::tuple<ArgsOne...> first_args, - std::tuple<ArgsTwo...> second_args) - : BaseOne(piecewise_construct, std::move(first_args), - typename MakeTupleIndices<sizeof...(ArgsOne)>::type()), - BaseTwo(piecewise_construct, std::move(second_args), - typename MakeTupleIndices<sizeof...(ArgsTwo)>::type()) + constexpr CompressedPair( + std::piecewise_construct_t piecewise_construct, + std::tuple<ArgsOne...> first_args, + std::tuple<ArgsTwo...> second_args + ) + : BaseOne( + piecewise_construct, + std::move(first_args), + typename MakeTupleIndices<sizeof...(ArgsOne)>::type() + ), + BaseTwo( + piecewise_construct, + std::move(second_args), + typename MakeTupleIndices<sizeof...(ArgsTwo)>::type() + ) { } |