[libsigcplusplus/variadic_mem_fun3: 139/148] Remove some now-unused tuple_type*<> type traits.



commit 5b6d0bd0c0d8de86bd135c13cf261554a38009e2
Author: Murray Cumming <murrayc murrayc com>
Date:   Mon Mar 7 09:44:10 2016 +0100

    Remove some now-unused tuple_type*<> type traits.
    
    Because we now motly only need the tuple*() utilities to manipulate
    the actual instances. Some are still need for those tuple*()
    implementations.

 sigc++/filelist.am                        |    1 -
 sigc++/tuple-utils/tuple_cat.h            |   58 -----------------------
 sigc++/tuple-utils/tuple_end.h            |   22 ---------
 sigc++/tuple-utils/tuple_transform_each.h |   61 -------------------------
 tests/Makefile.am                         |    2 -
 tests/test_tuple_cat.cc                   |   71 -----------------------------
 tests/test_tuple_end.cc                   |   37 ---------------
 tests/test_tuple_transform_each.cc        |   29 ------------
 8 files changed, 0 insertions(+), 281 deletions(-)
---
diff --git a/sigc++/filelist.am b/sigc++/filelist.am
index 295a2e3..08fa0be 100644
--- a/sigc++/filelist.am
+++ b/sigc++/filelist.am
@@ -41,7 +41,6 @@ sigc_public_h =                               \
        signal_base.h                   \
        slot.h                  \
        trackable.h                     \
-       tuple-utils/tuple_cat.h \
        tuple-utils/tuple_cdr.h \
        tuple-utils/tuple_end.h \
        tuple-utils/tuple_for_each.h \
diff --git a/sigc++/tuple-utils/tuple_end.h b/sigc++/tuple-utils/tuple_end.h
index c8eb1ad..60637ae 100644
--- a/sigc++/tuple-utils/tuple_end.h
+++ b/sigc++/tuple-utils/tuple_end.h
@@ -26,28 +26,6 @@ namespace internal {
 namespace detail {
 
 template <typename T, std::size_t remove_from_start>
-struct tuple_type_end_impl {
-  using type = typename tuple_type_end_impl<typename tuple_type_cdr<std::decay_t<T>>::type,
-    remove_from_start - 1>::type;
-};
-
-template <typename T>
-struct tuple_type_end_impl<T, 0> {
-  using type = T;
-};
-
-} // detail namespace
-
-/**
- * Get the type of a tuple with the last @a len types of the original.
- */
-template <typename T, std::size_t len>
-struct tuple_type_end
-  : detail::tuple_type_end_impl<T, std::tuple_size<T>::value - len> {};
-
-namespace detail {
-
-template <typename T, std::size_t remove_from_start>
 struct tuple_end_impl {
   static decltype(auto) // typename tuple_type_end<T, size - remove_from_start>::type
   tuple_end(T&& t) {
diff --git a/sigc++/tuple-utils/tuple_transform_each.h b/sigc++/tuple-utils/tuple_transform_each.h
index 77b48df..069e3a9 100644
--- a/sigc++/tuple-utils/tuple_transform_each.h
+++ b/sigc++/tuple-utils/tuple_transform_each.h
@@ -17,7 +17,6 @@
 #ifndef SIGC_TUPLE_UTILS_TUPLE_TRANSFORM_EACH_H
 #define SIGC_TUPLE_UTILS_TUPLE_TRANSFORM_EACH_H
 
-#include <sigc++/tuple-utils/tuple_cat.h>
 #include <sigc++/tuple-utils/tuple_cdr.h>
 #include <sigc++/tuple-utils/tuple_end.h>
 #include <sigc++/tuple-utils/tuple_start.h>
@@ -29,66 +28,6 @@ namespace internal {
 
 namespace detail {
 
-template <typename T, template <typename> class T_transformer,
-  std::size_t index>
-struct tuple_type_transform_each_impl {
-private:
-  using from_element_type = typename std::tuple_element<index, T>::type;
-
-  using to_element_type = typename std::result_of<decltype (
-    &T_transformer<from_element_type>::transform)(from_element_type&)>::type;
-
-  using t_element_type = std::tuple<to_element_type>;
-
-  using t_type_start = typename tuple_type_start<T, index>::type;
-
-  using t_type_end =
-    typename tuple_type_end<T, std::tuple_size<T>::value - index - 1>::type;
-
-  using t_type_with_transformed_element = typename tuple_type_cat<
-    typename tuple_type_cat<t_type_start, t_element_type>::type,
-    t_type_end>::type;
-
-public:
-  using type =
-    typename tuple_type_transform_each_impl<t_type_with_transformed_element,
-      T_transformer, index - 1>::type;
-};
-
-template <typename T, template <typename> class T_transformer>
-struct tuple_type_transform_each_impl<T, T_transformer, 0> {
-private:
-  static constexpr std::size_t index = 0;
-  using from_element_type = typename std::tuple_element<index, T>::type;
-  using to_element_type = typename std::result_of<decltype (
-    &T_transformer<from_element_type>::transform)(from_element_type&)>::type;
-  using t_element_type = std::tuple<to_element_type>;
-
-  using t_type_end =
-    typename tuple_type_end<T, std::tuple_size<std::decay_t<T>>::value - index - 1>::type;
-
-  using t_type_with_transformed_element =
-    typename tuple_type_cat<t_element_type, t_type_end>::type;
-
-public:
-  using type = t_type_with_transformed_element;
-};
-
-} // detail namespace
-
-/**
- * Get a tuple with each element having the transformed value of the element
- * in the original tuple.
- */
-
-template <typename T, template <typename> class T_transformer>
-struct tuple_type_transform_each {
-  using type = typename detail::tuple_type_transform_each_impl<T, T_transformer,
-    std::tuple_size<T>::value - 1>::type;
-};
-
-namespace detail {
-
 template <template <typename> class T_transformer, std::size_t size_from_index>
 struct tuple_transform_each_impl {
   // TODO: Avoid the need to pass t_original all the way into the recursion?
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 4039ef3..5bd81a2 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -51,7 +51,6 @@ check_PROGRAMS = \
   test_trackable \
   test_trackable_move \
   test_track_obj \
-  test_tuple_cat \
   test_tuple_cdr \
   test_tuple_end \
   test_tuple_for_each \
@@ -94,7 +93,6 @@ test_slot_move_SOURCES       = test_slot_move.cc $(sigc_test_util)
 test_trackable_SOURCES       = test_trackable.cc $(sigc_test_util)
 test_trackable_move_SOURCES  = test_trackable_move.cc $(sigc_test_util)
 test_track_obj_SOURCES       = test_track_obj.cc $(sigc_test_util)
-test_tuple_cat_SOURCES       = test_tuple_cat.cc $(sigc_test_util)
 test_tuple_cdr_SOURCES       = test_tuple_cdr.cc $(sigc_test_util)
 test_tuple_end_SOURCES       = test_tuple_end.cc $(sigc_test_util)
 test_tuple_for_each_SOURCES  = test_tuple_for_each.cc $(sigc_test_util)
diff --git a/tests/test_tuple_end.cc b/tests/test_tuple_end.cc
index 31d3f77..8eb313b 100644
--- a/tests/test_tuple_end.cc
+++ b/tests/test_tuple_end.cc
@@ -20,42 +20,6 @@
 #include <functional>
 
 void
-test_tuple_type_end() {
-  {
-    using type_tuple = std::tuple<int, short, double>;
-    using type_tuple_end = sigc::internal::tuple_type_end<type_tuple, 1>::type;
-    using type_tuple_expected = std::tuple<double>;
-
-    static_assert(std::tuple_size<type_tuple_end>::value == 1,
-      "unexpected tuple_end()ed tuple size.");
-    static_assert(std::is_same<type_tuple_end, type_tuple_expected>::value,
-      "unexpected type_tuple_end type");
-  }
-
-  {
-    using type_tuple = std::tuple<int, short, double>;
-    using type_tuple_end = sigc::internal::tuple_type_end<type_tuple, 2>::type;
-    using type_tuple_expected = std::tuple<short, double>;
-
-    static_assert(std::tuple_size<type_tuple_end>::value == 2,
-      "unexpected tuple_end()ed tuple size.");
-    static_assert(std::is_same<type_tuple_end, type_tuple_expected>::value,
-      "unexpected type_tuple_end type");
-  }
-
-  {
-    using type_tuple = std::tuple<int, short, double>;
-    using type_tuple_end = sigc::internal::tuple_type_end<type_tuple, 3>::type;
-    using type_tuple_expected = std::tuple<int, short, double>;
-
-    static_assert(std::tuple_size<type_tuple_end>::value == 3,
-      "unexpected tuple_end()ed tuple size.");
-    static_assert(std::is_same<type_tuple_end, type_tuple_expected>::value,
-      "unexpected type_tuple_end type");
-  }
-}
-
-void
 test_tuple_end() {
   {
     auto t_original =
@@ -124,7 +88,6 @@ test_tuple_end_stdref() {
 
 int
 main() {
-  test_tuple_type_end();
   test_tuple_end();
   test_tuple_end_stdref();
 
diff --git a/tests/test_tuple_transform_each.cc b/tests/test_tuple_transform_each.cc
index b1ff020..8830011 100644
--- a/tests/test_tuple_transform_each.cc
+++ b/tests/test_tuple_transform_each.cc
@@ -29,19 +29,6 @@ public:
   }
 };
 
-void
-test_tuple_type_transform_each_same_types() {
-  using type_tuple_original = std::tuple<int, int>;
-  using type_tuple_transformed =
-    sigc::internal::tuple_type_transform_each<type_tuple_original,
-      transform_to_string>::type;
-  using type_tuple_expected = std::tuple<std::string, std::string>;
-
-  static_assert(
-    std::is_same<type_tuple_transformed, type_tuple_expected>::value,
-    "unexpected tuple_transform_each()ed tuple type");
-}
-
 // In these tests, t_expected has elements all of the same type.
 void
 test_tuple_transform_each_same_types() {
@@ -120,19 +107,6 @@ public:
   }
 };
 
-void
-test_tuple_type_transform_each_multiple_types() {
-  using type_tuple_original = std::tuple<int, double, std::string>;
-  using type_tuple_transformed =
-    sigc::internal::tuple_type_transform_each<type_tuple_original,
-      transform_to_something>::type;
-  using type_tuple_expected = std::tuple<std::string, char, int>;
-
-  static_assert(
-    std::is_same<type_tuple_transformed, type_tuple_expected>::value,
-    "unexpected tuple_transform_each()ed tuple type");
-}
-
 // In these tests, t_expected has elements of different types.
 void
 test_tuple_transform_each_multiple_types() {
@@ -290,9 +264,6 @@ test_tuple_transform_each_empty_tuple() {
 
 int
 main() {
-  test_tuple_type_transform_each_same_types();
-  test_tuple_type_transform_each_multiple_types();
-
   test_tuple_transform_each_same_types();
   test_tuple_transform_each_multiple_types();
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]