[libsigc++2/variadic_bind3: 17/45] test_acum_iter: Replace signal_accumulated with signal<>::accumulated.



commit cce18598cd3a507997bc7a02979a8adc408072fa
Author: Murray Cumming <murrayc murrayc com>
Date:   Thu Jan 14 12:54:33 2016 +0100

    test_acum_iter: Replace signal_accumulated with signal<>::accumulated.
    
    I've never noticed this sub-template before, but this syntax is
    arguably nicer.

 sigc++/adaptors/adaptor_trait.h       |   17 -----------------
 sigc++/adaptors/bind_return.h         |    9 ---------
 sigc++/adaptors/macros/bind.h.m4      |   20 --------------------
 sigc++/adaptors/macros/hide.h.m4      |   23 -----------------------
 sigc++/adaptors/macros/retype.h.m4    |    9 ---------
 sigc++/adaptors/macros/track_obj.h.m4 |   11 -----------
 sigc++/adaptors/retype_return.h       |   18 ------------------
 tests/test_accum_iter.cc              |    2 +-
 8 files changed, 1 insertions(+), 108 deletions(-)
---
diff --git a/sigc++/adaptors/adaptor_trait.h b/sigc++/adaptors/adaptor_trait.h
index f76de9c..8c46ffb 100644
--- a/sigc++/adaptors/adaptor_trait.h
+++ b/sigc++/adaptors/adaptor_trait.h
@@ -37,11 +37,9 @@ namespace sigc {
 // depending on the compiler:
 #ifdef SIGC_GCC_TEMPLATE_SPECIALIZATION_OPERATOR_OVERLOAD
   #define SIGC_WORKAROUND_OPERATOR_PARENTHESES template operator()
-  #define SIGC_TEMPLATE_SPECIALIZATION_OPERATOR_OVERLOAD
 #else
   #ifdef SIGC_MSVC_TEMPLATE_SPECIALIZATION_OPERATOR_OVERLOAD
     #define SIGC_WORKAROUND_OPERATOR_PARENTHESES operator()
-    #define SIGC_TEMPLATE_SPECIALIZATION_OPERATOR_OVERLOAD
   #else
     #define SIGC_WORKAROUND_OPERATOR_PARENTHESES sun_forte_workaround
   #endif
@@ -91,11 +89,6 @@ struct adaptor_functor : public adaptor_base
   result_type
   operator()() const;
 
-  #ifndef SIGC_TEMPLATE_SPECIALIZATION_OPERATOR_OVERLOAD
-  result_type sun_forte_workaround() const
-    { return operator(); }
-  #endif
-
 
   /** Invokes the wrapped functor passing on the arguments.
    * @param _A_arg... Arguments to be passed on to the functor.
@@ -106,16 +99,6 @@ struct adaptor_functor : public adaptor_base
   operator()(T_arg... _A_arg) const
     { return functor_(_A_arg...); }
 
-  #ifndef SIGC_TEMPLATE_SPECIALIZATION_OPERATOR_OVERLOAD
-  template <class... T_arg>
-  decltype(auto)
-  sun_forte_workaround(T_arg... _A_arg) const
-    { //Just calling operator() tries to copy the argument:
-      return functor_(_A_arg...);
-    }
-  #endif
-
-
   /// Constructs an invalid functor.
   adaptor_functor()
     {}
diff --git a/sigc++/adaptors/bind_return.h b/sigc++/adaptors/bind_return.h
index 2e2b399..e6b129e 100644
--- a/sigc++/adaptors/bind_return.h
+++ b/sigc++/adaptors/bind_return.h
@@ -35,15 +35,6 @@ struct bind_return_functor : public adapts<T_functor>
         (_A_a...); return ret_value_.invoke();
     }
 
-  #ifndef SIGC_TEMPLATE_SPECIALIZATION_OPERATOR_OVERLOAD
-  template <class... T_arg>
-  inline typename unwrap_reference<T_return>::type sun_forte_workaround(T_arg... _A_a)
-    { this->functor_.SIGC_WORKAROUND_OPERATOR_PARENTHESES<type_trait_pass_t<T_arg>...>
-        (_A_a...); return ret_value_.invoke();
-    }
-  #endif
-
-
   /** Constructs a bind_return_functor object that fixes the return value to @p _A_ret_value.
    * @param _A_functor Functor to invoke from operator()().
    * @param _A_ret_value Value to return from operator()().
diff --git a/sigc++/adaptors/macros/bind.h.m4 b/sigc++/adaptors/macros/bind.h.m4
index 41fada8..655fd03 100644
--- a/sigc++/adaptors/macros/bind.h.m4
+++ b/sigc++/adaptors/macros/bind.h.m4
@@ -36,16 +36,6 @@ FOR(1, eval($2-1),[
     { return this->functor_.SIGC_WORKAROUND_OPERATOR_PARENTHESES<LIST(LOOP([type_trait_pass_t<T_arg%1>], 
eval($1-1)), type_trait_pass_t<typename unwrap_reference<T_bound>::type>, 
FOR($1,eval($2-1),[type_trait_pass_t<T_arg%1>,]))>
         (LIST(LOOP(_A_arg%1,eval($1-1)), bound_.invoke(), FOR($1,eval($2-1),[_A_arg%1,])));
     }
-
-  #ifndef SIGC_TEMPLATE_SPECIALIZATION_OPERATOR_OVERLOAD
-  template <LOOP([class T_arg%1], eval($2-1))>
-  decltype(auto)
-  sun_forte_workaround(LOOP(T_arg%1 _A_arg%1,eval($2-1)))
-    { return this->functor_.SIGC_WORKAROUND_OPERATOR_PARENTHESES<LIST(LOOP([type_trait_pass_t<T_arg%1>], 
eval($1-1)), type_trait_pass_t<typename unwrap_reference<T_bound>::type>, 
FOR($1,eval($2-1),[type_trait_pass_t<T_arg%1>,]))>
-        (LIST(LOOP(_A_arg%1,eval($1-1)), bound_.invoke(), FOR($1,eval($2-1),[_A_arg%1,])));
-    }
-  #endif
-
 ])dnl
 ])
 define([BIND_OPERATOR_COUNT],[dnl
@@ -61,16 +51,6 @@ FOR(1, eval($2-1),[
     { return this->functor_.SIGC_WORKAROUND_OPERATOR_PARENTHESES<LIST(LOOP([type_trait_pass_t<T_arg%1>], 
eval($2-1)), LOOP(type_trait_pass_t<typename unwrap_reference<T_type%1>::type>, $1))>
         (LIST(LOOP(_A_arg%1,eval($2-1)), LOOP(bound%1_.invoke(), $1)));
     }
-
-  #ifndef SIGC_TEMPLATE_SPECIALIZATION_OPERATOR_OVERLOAD
-  template <LOOP([class T_arg%1], eval($2-1))>
-  decltype(auto)
-  sun_forte_workaround(LOOP(T_arg%1 _A_arg%1, eval($2-1)))
-    { return this->functor_.SIGC_WORKAROUND_OPERATOR_PARENTHESES<LIST(LOOP([type_trait_pass_t<T_arg%1>], 
eval($2-1)), LOOP(type_trait_pass_t<typename unwrap_reference<T_type%1>::type>, $1))>
-        (LIST(LOOP(_A_arg%1,eval($2-1)), LOOP(bound%1_.invoke(), $1)));
-    }
-  #endif
-
 ])
 define([BIND_FUNCTOR_LOCATION],[dnl
 ifelse($1,1,[#ifndef DOXYGEN_SHOULD_SKIP_THIS
diff --git a/sigc++/adaptors/macros/hide.h.m4 b/sigc++/adaptors/macros/hide.h.m4
index c4140dc..0714c7a 100644
--- a/sigc++/adaptors/macros/hide.h.m4
+++ b/sigc++/adaptors/macros/hide.h.m4
@@ -34,13 +34,6 @@ ifelse($2,1,[dnl
   operator()(T_arg1)
     { return this->functor_(); }
 
-  #ifndef SIGC_TEMPLATE_SPECIALIZATION_OPERATOR_OVERLOAD
-  template <class T_arg1>
-  decltype(auto)
-  sun_forte_workaround(T_arg1 _A_a1)
-    { return this->functor_(); }
-  #endif
-
 ],$1,0,[dnl
   /** Invokes the wrapped functor, ignoring the last argument.dnl
 FOR(1, eval($2-1),[
@@ -54,14 +47,6 @@ FOR(1, eval($2-1),[
     { return 
this->functor_.SIGC_WORKAROUND_OPERATOR_PARENTHESES<LIST(FOR(1,eval($2-1),[type_trait_pass_t<T_arg%1>,]))>
         (LIST(FOR(1,eval($2-1),[_A_a%1,]))); }
 
-  #ifndef SIGC_TEMPLATE_SPECIALIZATION_OPERATOR_OVERLOAD
-  template <LOOP([class T_arg%1], $2)>
-  decltype(auto)
-  sun_forte_workaround(LOOP(T_arg%1 _A_a%1, eval($2-1)), T_arg$2)
-    { return 
this->functor_.SIGC_WORKAROUND_OPERATOR_PARENTHESES<LIST(FOR(1,eval($2-1),[type_trait_pass_t<T_arg%1>,]))>
-        (LIST(FOR(1,eval($2-1),[_A_a%1,]))); }
-  #endif
-
 ],[dnl
   /** Invokes the wrapped functor, ignoring the ORDINAL($1) argument.dnl
 FOR(1, eval($1-1),[
@@ -77,14 +62,6 @@ FOR(eval($1+1), $2,[
     { return 
this->functor_.SIGC_WORKAROUND_OPERATOR_PARENTHESES<LIST(FOR(1,eval($1-1),[type_trait_pass_t<T_arg%1>,]),FOR(eval($1+1),
 $2,[type_trait_pass_t<T_arg%1>,]))>
         (LIST(FOR(1,eval($1-1),[_A_a%1,]),FOR(eval($1+1),$2,[_A_a%1,]))); }
 
-  #ifndef SIGC_TEMPLATE_SPECIALIZATION_OPERATOR_OVERLOAD
-  template <LOOP([class T_arg%1], $2)>
-  decltype(auto)
-  sun_forte_workaround(LIST(FOR(1,eval($1-1),[T_arg%1 _A_a%1,]),T_arg$1,FOR(eval($1+1),$2,[T_arg%1 
_A_a%1,])))
-    { return 
this->functor_.SIGC_WORKAROUND_OPERATOR_PARENTHESES<LIST(FOR(1,eval($1-1),[type_trait_pass_t<T_arg%1>,]),FOR(eval($1+1),
 $2,[type_trait_pass_t<T_arg%1>,]))>
-        (LIST(FOR(1,eval($1-1),[_A_a%1,]),FOR(eval($1+1),$2,[_A_a%1,]))); }
-  #endif
-
 ])])dnl
 ])dnl end HIDE_OPERATOR
 
diff --git a/sigc++/adaptors/macros/retype.h.m4 b/sigc++/adaptors/macros/retype.h.m4
index 4cc5d03..e2b84a5 100644
--- a/sigc++/adaptors/macros/retype.h.m4
+++ b/sigc++/adaptors/macros/retype.h.m4
@@ -30,15 +30,6 @@ ifelse($1,0,[dnl
         (LOOP([[static_cast<T_type%1>(_A_a%1)]], $1));
     }
 
-  #ifndef SIGC_TEMPLATE_SPECIALIZATION_OPERATOR_OVERLOAD
-  template <LOOP(class T_arg%1, $1)>
-  decltype(auto)
-  sun_forte_workaround(LOOP(T_arg%1 _A_a%1, $1))
-    { return this->functor_.SIGC_WORKAROUND_OPERATOR_PARENTHESES<LOOP(type_trait_take_t<T_type%1>, $1)>
-        (LOOP([[static_cast<T_type%1>(_A_a%1)]], $1));
-    }
-  #endif
-
 ])dnl
 ])
 
diff --git a/sigc++/adaptors/macros/track_obj.h.m4 b/sigc++/adaptors/macros/track_obj.h.m4
index 0f8474b..971b701 100644
--- a/sigc++/adaptors/macros/track_obj.h.m4
+++ b/sigc++/adaptors/macros/track_obj.h.m4
@@ -183,17 +183,6 @@ public:
       (_A_arg...);
   }
 
-  #ifndef SIGC_TEMPLATE_SPECIALIZATION_OPERATOR_OVERLOAD
-  template <typename... T_arg>
-  decltype(auto)
-  sun_forte_workaround(T_arg... _A_arg)
-  {
-    return this->functor_.SIGC_WORKAROUND_OPERATOR_PARENTHESES<type_trait_pass_t<T_arg>...>
-      (_A_arg...);
-  }
-  #endif
-
-
 #ifndef DOXYGEN_SHOULD_SKIP_THIS
 //protected:
   // public, so that visit_each() can access it.
diff --git a/sigc++/adaptors/retype_return.h b/sigc++/adaptors/retype_return.h
index 4555bf4..56c0ac5 100644
--- a/sigc++/adaptors/retype_return.h
+++ b/sigc++/adaptors/retype_return.h
@@ -27,15 +27,6 @@ struct retype_return_functor : public adapts<T_functor>
         (_A_a...));
     }
 
-  #ifndef SIGC_TEMPLATE_SPECIALIZATION_OPERATOR_OVERLOAD
-  template <class... T_arg>
-  inline T_return sun_forte_workaround(T_arg... _A_a)
-    { return T_return(this->functor_.SIGC_WORKAROUND_OPERATOR_PARENTHESES<T_arg...>
-        (_A_a...));
-    }
-  #endif
-
-
   retype_return_functor() {}
 
   /** Constructs a retype_return_functor object that perform a C-style cast on the return value of the 
passed functor.
@@ -73,15 +64,6 @@ struct retype_return_functor<void, T_functor> : public adapts<T_functor>
         (_A_a...);
     }
 
-  #ifndef SIGC_TEMPLATE_SPECIALIZATION_OPERATOR_OVERLOAD
-  template <class... T_arg>
-  inline void sun_forte_workaround(T_arg... _A_a)
-    { this->functor_.SIGC_WORKAROUND_OPERATOR_PARENTHESES<T_arg...>
-        (_A_a...);
-    }
-  #endif
-
-
   retype_return_functor() {}
   retype_return_functor(type_trait_take_t<T_functor> _A_functor)
     : adapts<T_functor>(_A_functor)
diff --git a/tests/test_accum_iter.cc b/tests/test_accum_iter.cc
index 00f222d..b5947ec 100644
--- a/tests/test_accum_iter.cc
+++ b/tests/test_accum_iter.cc
@@ -39,7 +39,7 @@ int main(int argc, char* argv[])
   if (!util->check_command_args(argc, argv))
     return util->get_result_and_delete_instance() ? EXIT_SUCCESS : EXIT_FAILURE;
 
-  sigc::signal_with_accumulator<int, min_accum<int> > signal;
+  sigc::signal<int>::accumulated<min_accum<int>> signal;
 
   signal.connect(sigc::bind(sigc::ptr_fun(ident), 3));
   signal.connect(sigc::bind(sigc::ptr_fun(ident), 1));


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