aboutsummaryrefslogtreecommitdiff
path: root/src/DI/compressed_pair.hpp
diff options
context:
space:
mode:
authorHampusM <hampus@hampusmat.com>2022-04-24 17:13:52 +0200
committerHampusM <hampus@hampusmat.com>2022-06-13 17:56:58 +0200
commitdb6edcd473a684420e9a7611b24462df21165c1b (patch)
tree9646bdb4f5f6e339a0a01873b44e0b185476ce56 /src/DI/compressed_pair.hpp
parentb36d072ad7a7b9c6e30fcb25d6bbb001a8393468 (diff)
style: improve function and brace styling
Diffstat (limited to 'src/DI/compressed_pair.hpp')
-rw-r--r--src/DI/compressed_pair.hpp42
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()
+ )
{
}