[libsigc++2/variadic_bind4] Remove SIGC_WORKAROUND_OPERATOR_PARENTHESES, using just .template operator()<>.



commit 01d55d97109cc444e52e74659244726681dd8835
Author: Murray Cumming <murrayc murrayc com>
Date:   Thu Mar 3 10:17:07 2016 +0100

    Remove SIGC_WORKAROUND_OPERATOR_PARENTHESES, using just .template operator()<>.
    
    We can add it back if we find that the Sun or Microsoft compilers still
    need it, when/if they support enough C++14 anyway.
    We can always use libsigc++-2.0 to easily discover what its configure
    checks say about the compiler behaviour.

 build/cxx.m4                       |   94 ------------------------------------
 configure.ac                       |    2 -
 sigc++/adaptors/adaptor_trait.h    |    9 ----
 sigc++/adaptors/bind.h             |    4 +-
 sigc++/adaptors/bind_return.h      |    2 +-
 sigc++/adaptors/exception_catch.h  |    4 +-
 sigc++/adaptors/hide.h             |    2 +-
 sigc++/adaptors/macros/retype.h.m4 |    2 +-
 sigc++/adaptors/retype_return.h    |    4 +-
 sigc++/adaptors/track_obj.h        |    2 +-
 sigc++/functors/slot.h             |    2 +-
 11 files changed, 11 insertions(+), 116 deletions(-)
---
diff --git a/build/cxx.m4 b/build/cxx.m4
index 201a561..e299ab8 100644
--- a/build/cxx.m4
+++ b/build/cxx.m4
@@ -1,97 +1,3 @@
-dnl
-dnl SIGC_CXX_TEMPLATE_SPECIALIZATION_OPERATOR_OVERLOAD()
-dnl
-dnl
-AC_DEFUN([SIGC_CXX_GCC_TEMPLATE_SPECIALIZATION_OPERATOR_OVERLOAD],[
-AC_MSG_CHECKING([if C++ compiler supports the use of a particular specialization when calling operator() 
template methods.])
-AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
-[[
-  #include <iostream>
-
-  class Thing
-  {
-    public:
-    Thing()
-    {}
-
-    template <class T>
-    void operator()(T a, T b)
-    {
-      T c = a + b;
-      std::cout << c << std::endl;
-    }
-  };
-
-  template<class T2>
-  class OtherThing
-  {
-  public:
-    void do_something()
-    {
-       Thing thing_;
-       thing_.template operator()<T2>(1, 2);
-       //This fails with or without the template keyword, on SUN Forte C++ 5.3, 5.4, and 5.5:
-    }
-  };
-]],
-[[
-  OtherThing<int> thing;
-  thing.do_something();
-]])],
-[
-  sigcm_cxx_gcc_template_specialization_operator_overload=yes
-  AC_DEFINE([SIGC_GCC_TEMPLATE_SPECIALIZATION_OPERATOR_OVERLOAD],[1],[does the C++ compiler support the use 
of a particular specialization when calling operator() template methods.])
-],[
-  sigcm_cxx_gcc_template_specialization_operator_overload=no
-])
-AC_MSG_RESULT([$sigcm_cxx_gcc_template_specialization_operator_overload])
-])
-
-AC_DEFUN([SIGC_CXX_MSVC_TEMPLATE_SPECIALIZATION_OPERATOR_OVERLOAD],[
-AC_MSG_CHECKING([if C++ compiler supports the use of a particular specialization when calling operator() 
template methods omitting the template keyword.])
-AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
-[[
-  #include <iostream>
-
-  class Thing
-  {
-    public:
-    Thing()
-    {}
-
-    template <class T>
-    void operator()(T a, T b)
-    {
-      T c = a + b;
-      std::cout << c << std::endl;
-    }
-  };
-
-  template<class T2>
-  class OtherThing
-  {
-  public:
-    void do_something()
-    {
-       Thing thing_;
-       thing_.operator()<T2>(1, 2);
-       //This fails with or without the template keyword, on SUN Forte C++ 5.3, 5.4, and 5.5:
-    }
-  };
-]],
-[[
-  OtherThing<int> thing;
-  thing.do_something();
-]])],
-[
-  sigcm_cxx_msvc_template_specialization_operator_overload=yes
-  AC_DEFINE([SIGC_MSVC_TEMPLATE_SPECIALIZATION_OPERATOR_OVERLOAD],[1],[does the C++ compiler support the use 
of a particular specialization when calling operator() template methods omitting the template keyword.])
-],[
-  sigcm_cxx_msvc_template_specialization_operator_overload=no
-])
-AC_MSG_RESULT([$sigcm_cxx_msvc_template_specialization_operator_overload])
-])
-
 
 AC_DEFUN([SIGC_CXX_SELF_REFERENCE_IN_MEMBER_INITIALIZATION], [
 AC_MSG_CHECKING([if C++ compiler allows usage of member function in initialization of static member field.])
diff --git a/configure.ac b/configure.ac
index f6aa6f4..a3d135b 100644
--- a/configure.ac
+++ b/configure.ac
@@ -50,8 +50,6 @@ MM_ARG_ENABLE_DOCUMENTATION
 MM_ARG_WITH_TAGFILE_DOC([libstdc++.tag], [mm-common-libstdc++])
 
 AC_LANG([C++])
-SIGC_CXX_GCC_TEMPLATE_SPECIALIZATION_OPERATOR_OVERLOAD
-SIGC_CXX_MSVC_TEMPLATE_SPECIALIZATION_OPERATOR_OVERLOAD
 SIGC_CXX_SELF_REFERENCE_IN_MEMBER_INITIALIZATION
 SIGC_CXX_PRAGMA_PUSH_POP_MACRO
 SIGC_CXX_HAS_NAMESPACE_STD
diff --git a/sigc++/adaptors/adaptor_trait.h b/sigc++/adaptors/adaptor_trait.h
index aadf7e8..1b5d70b 100644
--- a/sigc++/adaptors/adaptor_trait.h
+++ b/sigc++/adaptors/adaptor_trait.h
@@ -33,15 +33,6 @@
  
 namespace sigc {
 
-// Call either operator()<>() or sun_forte_workaround<>(),
-// depending on the compiler:
-#ifdef SIGC_GCC_TEMPLATE_SPECIALIZATION_OPERATOR_OVERLOAD
-  #define SIGC_WORKAROUND_OPERATOR_PARENTHESES template operator()
-#else
-    #define SIGC_WORKAROUND_OPERATOR_PARENTHESES operator()
-#endif
-
-
 #ifndef DOXYGEN_SHOULD_SKIP_THIS
 template <class T_functor> struct adapts;
 #endif
diff --git a/sigc++/adaptors/bind.h b/sigc++/adaptors/bind.h
index a4a624b..d82f993 100644
--- a/sigc++/adaptors/bind.h
+++ b/sigc++/adaptors/bind.h
@@ -177,7 +177,7 @@ private:
   call_functor_operator_parentheses(T&& tuple,
     std::index_sequence<Is...>)
   {
-    return this->functor_.SIGC_WORKAROUND_OPERATOR_PARENTHESES<typename std::tuple_element<Is, 
T_specific>::type...>(std::get<Is>(std::forward<T>(tuple))...);
+    return this->functor_.template operator()<typename std::tuple_element<Is, 
T_specific>::type...>(std::get<Is>(std::forward<T>(tuple))...);
   }
 };
 
@@ -235,7 +235,7 @@ private:
   call_functor_operator_parentheses(T&& tuple,
     std::index_sequence<Is...>)
   {
-    return this->functor_.SIGC_WORKAROUND_OPERATOR_PARENTHESES<typename std::tuple_element<Is, 
T_specific>::type...>(std::get<Is>(std::forward<T>(tuple))...);
+    return this->functor_.template operator()<typename std::tuple_element<Is, 
T_specific>::type...>(std::get<Is>(std::forward<T>(tuple))...);
   }
 };
 
diff --git a/sigc++/adaptors/bind_return.h b/sigc++/adaptors/bind_return.h
index e6b129e..ff9525c 100644
--- a/sigc++/adaptors/bind_return.h
+++ b/sigc++/adaptors/bind_return.h
@@ -31,7 +31,7 @@ struct bind_return_functor : public adapts<T_functor>
    */
   template <class... T_arg>
   inline typename unwrap_reference<T_return>::type operator()(T_arg... _A_a)
-    { this->functor_.SIGC_WORKAROUND_OPERATOR_PARENTHESES<type_trait_pass_t<T_arg>...>
+    { this->functor_.template operator()<type_trait_pass_t<T_arg>...>
         (_A_a...); return ret_value_.invoke();
     }
 
diff --git a/sigc++/adaptors/exception_catch.h b/sigc++/adaptors/exception_catch.h
index 1ea7c3b..03b74c4 100644
--- a/sigc++/adaptors/exception_catch.h
+++ b/sigc++/adaptors/exception_catch.h
@@ -76,7 +76,7 @@ struct exception_catch_functor : public adapts<T_functor>
     {
       try
         {
-          return this->functor_.SIGC_WORKAROUND_OPERATOR_PARENTHESES<type_trait_pass_t<T_arg>...>
+          return this->functor_.template operator()<type_trait_pass_t<T_arg>...>
             (_A_a...);
         }
       catch (...)
@@ -105,7 +105,7 @@ struct exception_catch_functor<T_functor, T_catcher, void> : public adapts<T_fun
     {
       try
         {
-          return this->functor_.SIGC_WORKAROUND_OPERATOR_PARENTHESES<type_trait_pass_t<T_arg>...>
+          return this->functor_.template operator()<type_trait_pass_t<T_arg>...>
             (_A_a...);
         }
       catch (...)
diff --git a/sigc++/adaptors/hide.h b/sigc++/adaptors/hide.h
index 03056a6..8b9fc02 100644
--- a/sigc++/adaptors/hide.h
+++ b/sigc++/adaptors/hide.h
@@ -120,7 +120,7 @@ private:
   call_functor_operator_parentheses(T_tuple& tuple,
     std::index_sequence<Is...>)
   {
-    return this->functor_.SIGC_WORKAROUND_OPERATOR_PARENTHESES<typename std::tuple_element<Is, 
T_tuple_specific>::type...>(std::get<Is>(tuple)...);
+    return this->functor_.template operator()<typename std::tuple_element<Is, 
T_tuple_specific>::type...>(std::get<Is>(tuple)...);
   }
 };
 
diff --git a/sigc++/adaptors/macros/retype.h.m4 b/sigc++/adaptors/macros/retype.h.m4
index 9970728..dd69839 100644
--- a/sigc++/adaptors/macros/retype.h.m4
+++ b/sigc++/adaptors/macros/retype.h.m4
@@ -111,7 +111,7 @@ struct retype_functor
  template <class... T_arg>
   decltype(auto)
   operator()(T_arg... _A_a)
-    { return this->functor_.SIGC_WORKAROUND_OPERATOR_PARENTHESES<type_trait_take_t<T_type>...>
+    { return this->functor_.template operator()<type_trait_take_t<T_type>...>
         (static_cast<T_type>(_A_a)...);
     }
 
diff --git a/sigc++/adaptors/retype_return.h b/sigc++/adaptors/retype_return.h
index e01a00a..29b8eb0 100644
--- a/sigc++/adaptors/retype_return.h
+++ b/sigc++/adaptors/retype_return.h
@@ -23,7 +23,7 @@ struct retype_return_functor : public adapts<T_functor>
 
   template <class... T_arg>
   inline T_return operator()(T_arg&&... _A_a)
-    { return T_return(this->functor_.SIGC_WORKAROUND_OPERATOR_PARENTHESES<T_arg...>
+    { return T_return(this->functor_.template operator()<T_arg...>
         (std::forward<T_arg>(_A_a)...));
     }
 
@@ -60,7 +60,7 @@ struct retype_return_functor<void, T_functor> : public adapts<T_functor>
 
   template <class... T_arg>
   inline void operator()(T_arg... _A_a)
-    { this->functor_.SIGC_WORKAROUND_OPERATOR_PARENTHESES<T_arg...>
+    { this->functor_.template operator()<T_arg...>
         (_A_a...);
     }
 
diff --git a/sigc++/adaptors/track_obj.h b/sigc++/adaptors/track_obj.h
index 61830fc..43ae600 100644
--- a/sigc++/adaptors/track_obj.h
+++ b/sigc++/adaptors/track_obj.h
@@ -76,7 +76,7 @@ public:
   decltype(auto)
   operator()(T_arg&&... _A_arg)
   {
-    return this->functor_.SIGC_WORKAROUND_OPERATOR_PARENTHESES<type_trait_pass_t<T_arg>...>
+    return this->functor_.template operator()<type_trait_pass_t<T_arg>...>
       (std::forward<T_arg>(_A_arg)...);
   }
 
diff --git a/sigc++/functors/slot.h b/sigc++/functors/slot.h
index ea07944..66ad68e 100644
--- a/sigc++/functors/slot.h
+++ b/sigc++/functors/slot.h
@@ -113,7 +113,7 @@ struct slot_call
     {
       typedef typed_slot_rep<T_functor> typed_slot;
       typed_slot *typed_rep = static_cast<typed_slot*>(rep);
-      return (typed_rep->functor_).SIGC_WORKAROUND_OPERATOR_PARENTHESES<type_trait_take_t<T_arg>...>
+      return (typed_rep->functor_).template operator()<type_trait_take_t<T_arg>...>
                (a_...);
     }
 


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