summaryrefslogtreecommitdiff
path: root/sigc++/tuple-utils/tuple_start.h
diff options
context:
space:
mode:
authorMurray Cumming <murrayc@murrayc.com>2019-10-28 12:16:22 +0100
committerMurray Cumming <murrayc@murrayc.com>2019-10-28 12:26:02 +0100
commit294ce7177c5315e2ada29acd184900dcda4289c8 (patch)
treec114ef20e9689f8dedcedc700a66f0936a69ba3c /sigc++/tuple-utils/tuple_start.h
parent8d747d775ae9da0a7703d28333dc326d81b36120 (diff)
downloadsigc++-294ce7177c5315e2ada29acd184900dcda4289c8.tar.gz
Reformat code with make format
Diffstat (limited to 'sigc++/tuple-utils/tuple_start.h')
-rw-r--r--sigc++/tuple-utils/tuple_start.h48
1 files changed, 26 insertions, 22 deletions
diff --git a/sigc++/tuple-utils/tuple_start.h b/sigc++/tuple-utils/tuple_start.h
index c220a92..6c83030 100644
--- a/sigc++/tuple-utils/tuple_start.h
+++ b/sigc++/tuple-utils/tuple_start.h
@@ -21,15 +21,18 @@
#include <tuple>
#include <utility>
-namespace sigc::internal {
+namespace sigc::internal
+{
-namespace detail {
+namespace detail
+{
-template <typename T, typename Seq>
+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...>> {
+template<typename T, std::size_t... I>
+struct tuple_type_start_impl<T, std::index_sequence<I...>>
+{
using type = std::tuple<typename std::tuple_element<I, T>::type...>;
};
@@ -38,21 +41,22 @@ 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>> {};
+template<typename T, std::size_t 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>
+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) {
+template<typename T, std::size_t... I>
+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.");
@@ -67,11 +71,11 @@ 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.
+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 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.");
@@ -81,4 +85,4 @@ tuple_start(T&& t) {
} // namespace sigc::internal;
-#endif //SIGC_TUPLE_UTILS_TUPLE_START_H
+#endif // SIGC_TUPLE_UTILS_TUPLE_START_H