diff options
author | Murray Cumming <murrayc@murrayc.com> | 2016-03-30 16:06:05 +0200 |
---|---|---|
committer | Murray Cumming <murrayc@murrayc.com> | 2016-03-30 16:06:05 +0200 |
commit | 7fa1c252e8562f3581087c6df64b334198f6b27d (patch) | |
tree | 0476e337cc9e81288fc022df5c26141bae7cfa73 /sigc++/tuple-utils/tuple_start.h | |
parent | 6964db1f78e2a0900a4eca36f87ffdb9bb5c3954 (diff) | |
download | sigc++-7fa1c252e8562f3581087c6df64b334198f6b27d.tar.gz |
Reformat .h files with clang-format.
Diffstat (limited to 'sigc++/tuple-utils/tuple_start.h')
-rw-r--r-- | sigc++/tuple-utils/tuple_start.h | 39 |
1 files changed, 22 insertions, 17 deletions
diff --git a/sigc++/tuple-utils/tuple_start.h b/sigc++/tuple-utils/tuple_start.h index 86b6066..06491ce 100644 --- a/sigc++/tuple-utils/tuple_start.h +++ b/sigc++/tuple-utils/tuple_start.h @@ -21,17 +21,21 @@ #include <tuple> #include <utility> -namespace sigc { +namespace sigc +{ -namespace internal { +namespace internal +{ -namespace detail { +namespace detail +{ template <typename T, typename Seq> struct tuple_type_start_impl; template <typename T, std::size_t... I> -struct tuple_type_start_impl<T, std::index_sequence<I...>> { +struct tuple_type_start_impl<T, std::index_sequence<I...>> +{ using type = std::tuple<typename std::tuple_element<I, T>::type...>; }; @@ -41,20 +45,21 @@ struct tuple_type_start_impl<T, std::index_sequence<I...>> { * Get the type of a tuple with just the first @len items. */ template <typename T, std::size_t len> -struct tuple_type_start - : detail::tuple_type_start_impl<T, std::make_index_sequence<len>> {}; +struct tuple_type_start : detail::tuple_type_start_impl<T, std::make_index_sequence<len>> +{ +}; -namespace detail { +namespace detail +{ template <typename T, typename Seq> struct tuple_start_impl; template <typename T, std::size_t... I> -struct tuple_start_impl<T, std::index_sequence<I...>> { - static - constexpr - decltype(auto) - tuple_start(T&& t) { +struct tuple_start_impl<T, std::index_sequence<I...>> +{ + static constexpr decltype(auto) tuple_start(T&& t) + { constexpr auto size = std::tuple_size<std::decay_t<T>>::value; constexpr auto len = sizeof...(I); static_assert(len <= size, "The tuple size must be less than or equal to the length."); @@ -70,10 +75,10 @@ struct tuple_start_impl<T, std::index_sequence<I...>> { * Get the tuple with the last @a len items of the original. */ template <std::size_t len, typename T> -constexpr -decltype(auto) // typename tuple_type_end<T, len>::type -tuple_start(T&& t) { - //We use std::decay_t<> because tuple_size is not defined for references. +constexpr decltype(auto) // typename tuple_type_end<T, len>::type + tuple_start(T&& t) +{ + // We use std::decay_t<> because tuple_size is not defined for references. constexpr auto size = std::tuple_size<std::decay_t<T>>::value; static_assert(len <= size, "The tuple size must be less than or equal to the length."); @@ -85,4 +90,4 @@ tuple_start(T&& t) { } // namespace sigc -#endif //SIGC_TUPLE_UTILS_TUPLE_START_H +#endif // SIGC_TUPLE_UTILS_TUPLE_START_H |