[libsigc++2/variadic] bind_functor::operator()(): Give this a dummy template parameter.



commit b434c16b6ae668b96982f5eab457cfe15751fa64
Author: Murray Cumming <murrayc murrayc com>
Date:   Fri Jan 15 08:57:17 2016 +0100

    bind_functor::operator()(): Give this a dummy template parameter.
    
    And remove the m4 ifelse from slot.h.m4 because we can now resolve
    that operator() when calling it with an empty variadic parameter pack.

 sigc++/adaptors/macros/bind.h.m4 |    2 ++
 sigc++/functors/macros/slot.h.m4 |    4 ----
 2 files changed, 2 insertions(+), 4 deletions(-)
---
diff --git a/sigc++/adaptors/macros/bind.h.m4 b/sigc++/adaptors/macros/bind.h.m4
index 07f82b4..80b5f90 100644
--- a/sigc++/adaptors/macros/bind.h.m4
+++ b/sigc++/adaptors/macros/bind.h.m4
@@ -71,6 +71,7 @@ struct bind_functor<$1, T_functor, T_bound, LIST(LOOP(nil, CALL_SIZE - 1))> : pu
   /** Invokes the wrapped functor passing on the bound argument only.
    * @return The return value of the functor invocation.
    */
+  template <class T_DummyArg = void> //TODO: Remove this workaround when operator() is variadic. See 
https://bugzilla.gnome.org/show_bug.cgi?id=753612#c25
   decltype(auto)
   operator()()
   {
@@ -110,6 +111,7 @@ struct bind_functor<LIST(-1, T_functor, LIST(LOOP(T_type%1, $1), LOOP(nil, CALL_
   /** Invokes the wrapped functor passing on the bound argument only.
    * @return The return value of the functor invocation.
    */
+  template <class T_DummyArg = void> //TODO: Remove this workaround when operator() is variadic. See 
https://bugzilla.gnome.org/show_bug.cgi?id=753612#c25
   decltype(auto)
   operator()()
   {
diff --git a/sigc++/functors/macros/slot.h.m4 b/sigc++/functors/macros/slot.h.m4
index e1338a9..5e2d407 100644
--- a/sigc++/functors/macros/slot.h.m4
+++ b/sigc++/functors/macros/slot.h.m4
@@ -332,12 +332,8 @@ FOR(1, $1,[
       //TODO_variadic: Avoid the specific call to the () overload when
       //bind_functor::operator() is variadic. Then we can make this whole class
       //variadic, and others that use it.
-ifelse($1,0,[
-      return (typed_rep->functor_)();
-],[
       return (typed_rep->functor_).SIGC_WORKAROUND_OPERATOR_PARENTHESES<type_trait_take_t<T_arg>...>
                (a_...);
-])dnl
     }
 
   /** Forms a function pointer from call_it().


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