Re: Re: [sigc] libsigc++ 1.9.13 fails on Solaris 9 sparc



On Thu, 2004-03-25 at 21:28, Martin Schulze wrote:
> Yes, we must do that unless somebody magically comes up with a
> different solution. Obviously nobody did. I don't really like the
> idea because it will almost double the code size of the adaptors
> but there is no way around it.
> 
> > Unless
> > you are doing this yourself, I will try to implement this.
> 
> I will work on this tomorrow on the train and will commit to cvs
> late in the evening. I'll drop a note if I couldn't finish.

I have done it and committed it. Here's the patch.

Damien, could you please try this test tarball, which has this change:
http://www.murrayc.com/temp/libsigc++-1.9.15test.tar.gz

-- 
Murray Cumming
www.murrayc.com
murrayc murrayc com
? .in
? config.h.in
? libsigc++2.kdevprj
? libsigc++2.kdevses
? sigc++config.h
? stamp-h1
? sun_forte_workaround.patch
? temp.diff
? temp_14th.diff
? temp_14to19th.diff
? temp_19th.diff
? template_operator.cc
? working.patch
? docs/reference/xml
? sigc++/stamp-h1
Index: ChangeLog
===================================================================
RCS file: /cvs/gnome/libsigc++2/ChangeLog,v
retrieving revision 1.90
diff -u -p -r1.90 ChangeLog
--- ChangeLog	21 Mar 2004 23:45:55 -0000	1.90
+++ ChangeLog	25 Mar 2004 20:12:02 -0000
@@ -1,3 +1,15 @@
+2004-03-25  Murray Cumming  <murrayc murrayc com>
+
+	* scripts/cxx.m4, configure.in, sigc++config.h.in: Rename the 
+	template_keyword check to template_specialization, because the problem
+	is with or without the keyword.
+	* sigc++/adaptors/macros/adaptor_trait.h.m4: Define 
+	SIGC_WORKAROUND_OPERATOR_PARENTHESES, which calls either operator() or 
+	sun_forte_workaround() depending on the result of the compiler test.
+	* many .m4 files: Add sun_forte_workaround methods that call the 
+	operator() methods. Put them in #ifdefs so that only SUN Forte C++ 
+	sees them.
+
 2004-03-22  Murray Cumming  <murrayc murrayc com>
 
 	* Makefile.am, sigc++/Makfile.am: Fix the sigc++config.h.in disting,
Index: configure.ac
===================================================================
RCS file: /cvs/gnome/libsigc++2/configure.ac,v
retrieving revision 1.22
diff -u -p -r1.22 configure.ac
--- configure.ac	21 Mar 2004 13:44:23 -0000	1.22
+++ configure.ac	25 Mar 2004 20:12:02 -0000
@@ -68,7 +68,7 @@ dnl Using C++ compiler
 AC_PROG_CXX
 AC_LANG_CPLUSPLUS
 
-SIGC_CXX_TEMPLATE_KEYWORD_OPERATOR_OVERLOAD()
+SIGC_CXX_TEMPLATE_SPECIALIZATION_OPERATOR_OVERLOAD()
 
 if test "X$config_error" = "Xyes" ; then
   AC_ERROR(
Index: sigc++config.h.in
===================================================================
RCS file: /cvs/gnome/libsigc++2/sigc++config.h.in,v
retrieving revision 1.1
diff -u -p -r1.1 sigc++config.h.in
--- sigc++config.h.in	21 Mar 2004 13:44:23 -0000	1.1
+++ sigc++config.h.in	25 Mar 2004 20:12:02 -0000
@@ -54,5 +54,5 @@
 /* Version number of package */
 #undef VERSION
 
-#undef SIGC_TEMPLATE_KEYWORD_OPERATOR_OVERLOAD
+#undef SIGC_TEMPLATE_SPECIALIZATION_OPERATOR_OVERLOAD
 
Index: scripts/cxx.m4
===================================================================
RCS file: /cvs/gnome/libsigc++2/scripts/cxx.m4,v
retrieving revision 1.1
diff -u -p -r1.1 cxx.m4
--- scripts/cxx.m4	19 Mar 2004 23:13:42 -0000	1.1
+++ scripts/cxx.m4	25 Mar 2004 20:12:02 -0000
@@ -1,10 +1,9 @@
 dnl
-dnl SIGC_CXX_TEMPLATE_KEYWORD_OPERATOR_OVERLOAD()
+dnl SIGC_CXX_TEMPLATE_SPECIALIZATION_OPERATOR_OVERLOAD()
 dnl
-dnl Test whether the compiler supports the template keyword when calling operator() template methods.
 dnl
-AC_DEFUN([SIGC_CXX_TEMPLATE_KEYWORD_OPERATOR_OVERLOAD],[
-AC_MSG_CHECKING([if C++ compiler supports the template keyword when calling operator() template methods.])
+AC_DEFUN([SIGC_CXX_TEMPLATE_SPECIALIZATION_OPERATOR_OVERLOAD],[
+AC_MSG_CHECKING([if C++ compiler supports the use of a particular specialization when calling operator() template methods.])
 AC_TRY_COMPILE(
 [
   #include <iostream>
@@ -25,16 +24,18 @@ AC_TRY_COMPILE(
 ],
 [
     Thing thing_;
+
+    //This fails with or without the template keyword, on SUN Forte C++ 5.3, 5.4, and 5.5:
     thing_.template operator()<int>(1, 2);
 ],
 [
-  sigcm_cxx_template_keyword_operator_overload=yes
-  AC_DEFINE([SIGC_TEMPLATE_KEYWORD_OPERATOR_OVERLOAD],[1],[does the compiler support the template keyword when calling operator() template methods.])
-  AC_MSG_RESULT([$sigcm_cxx_template_keyword_operator_overload])
+  sigcm_cxx_template_specialization_operator_overload=yes
+  AC_DEFINE([SIGC_TEMPLATE_SPECIALIZATION_OPERATOR_OVERLOAD],[1],[does the C++ compiler support the use of a particular specialization when calling operator() template methods.])
+  AC_MSG_RESULT([$sigcm_cxx_template_specialization_operator_overload])
 ],[
-  sigcm_cxx_template_keyword_operator_overload=no
-  AC_DEFINE([SIGC_TEMPLATE_KEYWORD_OPERATOR_OVERLOAD],[0])
-  AC_MSG_RESULT([$sigcm_cxx_template_keyword_operator_overload])
+  sigcm_cxx_template_specialization_operator_overload=no
+  AC_DEFINE([SIGC_TEMPLATE_SPECIALIZATION_OPERATOR_OVERLOAD],[0])
+  AC_MSG_RESULT([$sigcm_cxx_template_specialization_operator_overload])
 ])
 ])
 
Index: sigc++/adaptors/lambda/macros/base.h.m4
===================================================================
RCS file: /cvs/gnome/libsigc++2/sigc++/adaptors/lambda/macros/base.h.m4,v
retrieving revision 1.3
diff -u -p -r1.3 base.h.m4
--- sigc++/adaptors/lambda/macros/base.h.m4	13 Mar 2004 12:12:33 -0000	1.3
+++ sigc++/adaptors/lambda/macros/base.h.m4	25 Mar 2004 20:12:02 -0000
@@ -21,16 +21,29 @@ define([LAMBDA_DO],[dnl
   template <LOOP(class T_arg%1, $1)>
   typename deduce_result_type<LOOP(T_arg%1,$1)>::type
   operator ()(LOOP(T_arg%1 _A_%1, $1)) const 
-    { return value_.LIBSIGC_TEMPLATE_PREFIX operator()<LOOP(_P_(T_arg%1), $1)>
+    { return value_.LIBSIGC_TEMPLATE_PREFIX SIGC_WORKAROUND_OPERATOR_PARENTHESES<LOOP(_P_(T_arg%1), $1)>
              (LOOP(_A_%1, $1)); 
     }
 
+  #ifndef SIGC_TEMPLATE_SPECIALIZATION_OPERATOR_OVERLOAD
+  template <LOOP(class T_arg%1, $1)>
+  typename deduce_result_type<LOOP(T_arg%1,$1)>::type
+  sun_forte_workaround(LOOP(T_arg%1 _A_%1, $1)) const
+    { return operator()(LOOP(_A_%1, $1)); }
+  #endif //SIGC_TEMPLATE_SPECIALIZATION_OPERATOR_OVERLOAD
+
 ])dnl
 define([LAMBDA_DO_VALUE],[dnl
   template <LOOP(class T_arg%1, $1)>
   result_type operator ()(LOOP(T_arg%1 _A_%1, $1)) const 
     { return value_; }
 
+  #ifndef SIGC_TEMPLATE_SPECIALIZATION_OPERATOR_OVERLOAD
+  template <LOOP(class T_arg%1, $1)>
+  result_type sun_forte_workaround(LOOP(T_arg%1 _A_%1, $1)) const
+    { return operator()(LOOP(_A_%1, $1)); }
+  #endif //SIGC_TEMPLATE_SPECIALIZATION_OPERATOR_OVERLOAD
+
 ])dnl
 
 divert(0)dnl
Index: sigc++/adaptors/lambda/macros/group.h.m4
===================================================================
RCS file: /cvs/gnome/libsigc++2/sigc++/adaptors/lambda/macros/group.h.m4,v
retrieving revision 1.2
diff -u -p -r1.2 group.h.m4
--- sigc++/adaptors/lambda/macros/group.h.m4	13 Mar 2004 12:12:33 -0000	1.2
+++ sigc++/adaptors/lambda/macros/group.h.m4	25 Mar 2004 20:12:03 -0000
@@ -40,6 +40,13 @@ dnl Please someone get a gun!
   operator() (LOOP(T_arg%1 _A_%1, $2)) const
     { return (func_(LOOP(_A_%1, $2)))(LOOP(value%1_(_L_),$1)); }
 
+  #ifndef SIGC_TEMPLATE_SPECIALIZATION_OPERATOR_OVERLOAD
+  template <LOOP(class T_arg%1, $2)>
+  typename deduce_result_type<LOOP(T_arg%1,$2)>::type
+  sun_forte_workaround (LOOP(T_arg%1 _A_%1, $2)) const
+    { return operator()( LOOP(_A_%1, $2) ); }
+  #endif //SIGC_TEMPLATE_SPECIALIZATION_OPERATOR_OVERLOAD
+
 ])
 dnl
 dnl This really doesn't have much to do with lambda other than
Index: sigc++/adaptors/lambda/macros/operator.h.m4
===================================================================
RCS file: /cvs/gnome/libsigc++2/sigc++/adaptors/lambda/macros/operator.h.m4,v
retrieving revision 1.2
diff -u -p -r1.2 operator.h.m4
--- sigc++/adaptors/lambda/macros/operator.h.m4	13 Mar 2004 12:12:33 -0000	1.2
+++ sigc++/adaptors/lambda/macros/operator.h.m4	25 Mar 2004 20:12:03 -0000
@@ -27,12 +27,21 @@ define([LAMBDA_OPERATOR_DO],[dnl
       return lambda_action<T_action>::template do_action<
             typename deduce_result_type<LOOP(T_arg%1,$1)>::left_type,
             typename deduce_result_type<LOOP(T_arg%1,$1)>::right_type>
-        (arg1_.LIBSIGC_TEMPLATE_PREFIX operator()<LOOP(_P_(T_arg%1), $1)>
+        (arg1_.LIBSIGC_TEMPLATE_PREFIX SIGC_WORKAROUND_OPERATOR_PARENTHESES<LOOP(_P_(T_arg%1), $1)>
             (LOOP(_A_%1, $1)),
-         arg2_.LIBSIGC_TEMPLATE_PREFIX operator()<LOOP(_P_(T_arg%1), $1)>
+         arg2_.LIBSIGC_TEMPLATE_PREFIX SIGC_WORKAROUND_OPERATOR_PARENTHESES<LOOP(_P_(T_arg%1), $1)>
             (LOOP(_A_%1, $1)));
     }
 
+  #ifndef SIGC_TEMPLATE_SPECIALIZATION_OPERATOR_OVERLOAD
+  template <LOOP(class T_arg%1, $1)>
+  typename deduce_result_type<LOOP(T_arg%1,$1)>::type
+  sun_forte_workaround(LOOP(T_arg%1 _A_%1, $1)) const
+    {
+      return operator()( LOOP(_A_%1, $1) );
+    }
+  #endif //SIGC_TEMPLATE_SPECIALIZATION_OPERATOR_OVERLOAD
+
 ])
 define([LAMBDA_OPERATOR_UNARY_DO],[dnl
   template <LOOP(class T_arg%1, $1)>
@@ -41,10 +50,19 @@ define([LAMBDA_OPERATOR_UNARY_DO],[dnl
     {
       return lambda_action_unary<T_action>::template do_action<
             typename deduce_result_type<LOOP(T_arg%1,$1)>::operand_type>
-        (arg_.LIBSIGC_TEMPLATE_PREFIX operator()<LOOP(_P_(T_arg%1), $1)>
+        (arg_.LIBSIGC_TEMPLATE_PREFIX SIGC_WORKAROUND_OPERATOR_PARENTHESES<LOOP(_P_(T_arg%1), $1)>
             (LOOP(_A_%1, $1)));
     }
 
+  #ifndef SIGC_TEMPLATE_SPECIALIZATION_OPERATOR_OVERLOAD
+  template <LOOP(class T_arg%1, $1)>
+  typename deduce_result_type<LOOP(T_arg%1,$1)>::type
+  sun_forte_workaround(LOOP(T_arg%1 _A_%1, $1)) const
+    {
+      return operator()( LOOP(_A_%1, $1) );
+    }
+  #endif
+
 ])
 define([LAMBDA_OPERATOR_CONVERT_DO],[dnl
   template <LOOP(class T_arg%1, $1)>
@@ -53,10 +71,19 @@ define([LAMBDA_OPERATOR_CONVERT_DO],[dnl
     {
       return lambda_action_convert<T_action, T_type>::template do_action<
             typename deduce_result_type<LOOP(T_arg%1,$1)>::operand_type>
-        (arg_.LIBSIGC_TEMPLATE_PREFIX operator()<LOOP(_P_(T_arg%1), $1)>
+        (arg_.LIBSIGC_TEMPLATE_PREFIX SIGC_WORKAROUND_OPERATOR_PARENTHESES<LOOP(_P_(T_arg%1), $1)>
             (LOOP(_A_%1, $1)));
     }
 
+  #ifndef SIGC_TEMPLATE_SPECIALIZATION_OPERATOR_OVERLOAD
+  template <LOOP(class T_arg%1, $1)>
+  typename deduce_result_type<LOOP(T_arg%1,$1)>::type
+  sun_forte_workaround(LOOP(T_arg%1 _A_%1, $1)) const
+    {
+      return operator()( LOOP(_A_%1, $1) );
+    }
+  #endif
+
 ])
 define([LAMBDA_OPERATOR],[dnl
 dnl TODO: check for this compiler bug and consequectly don't use typeof() if compiler is buggy:
Index: sigc++/adaptors/lambda/macros/select.h.m4
===================================================================
RCS file: /cvs/gnome/libsigc++2/sigc++/adaptors/lambda/macros/select.h.m4,v
retrieving revision 1.1
diff -u -p -r1.1 select.h.m4
--- sigc++/adaptors/lambda/macros/select.h.m4	2 Nov 2003 13:40:57 -0000	1.1
+++ sigc++/adaptors/lambda/macros/select.h.m4	25 Mar 2004 20:12:03 -0000
@@ -22,6 +22,13 @@ dnl Macros to make select arguments
 define([LAMBDA_SELECT_DO],[dnl
   template <LOOP(class T_arg%1, $2)>
   T_arg$1 operator ()(LOOP(T_arg%1 _A_%1, $2)) const { return _A_$1; }
+
+  #ifndef SIGC_TEMPLATE_SPECIALIZATION_OPERATOR_OVERLOAD
+  template <LOOP(class T_arg%1, $2)>
+  //Does not work: T_arg$1 sun_forte_workaround(LOOP(T_arg%1 _A_%1, $2)) const { return operator()( LOOP(_A_%1, $2) ); }
+  T_arg$1 sun_forte_workaround(LOOP(T_arg%1 _A_%1, $2)) const { return _A_$1; }
+  #endif
+  
 ])
 define([LAMBDA_SELECT],[dnl
 struct lambda_select$1 : public lambda_base
Index: sigc++/adaptors/macros/adaptor_trait.h.m4
===================================================================
RCS file: /cvs/gnome/libsigc++2/sigc++/adaptors/macros/adaptor_trait.h.m4,v
retrieving revision 1.6
diff -u -p -r1.6 adaptor_trait.h.m4
--- sigc++/adaptors/macros/adaptor_trait.h.m4	21 Mar 2004 13:44:25 -0000	1.6
+++ sigc++/adaptors/macros/adaptor_trait.h.m4	25 Mar 2004 20:12:03 -0000
@@ -58,6 +58,15 @@ FOR(1, $1,[
   operator()(LOOP(T_arg%1 _A_arg%1, $1)) const
     { return functor_(LOOP(_A_arg%1, $1)); }
 
+  #ifndef SIGC_TEMPLATE_SPECIALIZATION_OPERATOR_OVERLOAD
+  template <LOOP([class T_arg%1], $1)>
+  typename deduce_result_type<LOOP(T_arg%1, $1)>::type
+  sun_forte_workaround(LOOP(T_arg%1 _A_arg%1, $1)) const
+    { //Just calling operator() tries to copy the argument:
+      return functor_(LOOP(_A_arg%1, $1));
+    }
+  #endif
+  
 ])dnl
 ])
 
@@ -72,14 +81,24 @@ __FIREWALL__
 
 namespace sigc {
 
-#ifndef SIGC_TEMPLATE_KEYWORD_OPERATOR_OVERLOAD
+// Call either operator()<>() or sun_forte_workaround<>(),
+// depending on the compiler:
+#ifdef SIGC_TEMPLATE_SPECIALIZATION_OPERATOR_OVERLOAD
+  #define SIGC_WORKAROUND_OPERATOR_PARENTHESES operator()
+#else
+  #define SIGC_WORKAROUND_OPERATOR_PARENTHESES sun_forte_workaround
+#endif
+
+// TODO: This should have its own test, without using operator()
+#ifdef SIGC_TEMPLATE_SPECIALIZATION_OPERATOR_OVERLOAD
+  #define LIBSIGC_TEMPLATE_PREFIX template
+#else
   //The MSVC++ and SUN Forte C++ compilers have problems with this,
   //though the SUN Forte C++ compiler allows it in some places.
   #define LIBSIGC_TEMPLATE_PREFIX
-#else
-  #define LIBSIGC_TEMPLATE_PREFIX template
 #endif
 
+
 template <class T_functor> struct adapts;
 
 /** @defgroup adaptors Adaptors
@@ -123,6 +142,11 @@ struct adaptor_functor : public adaptor_
   result_type
   operator()() const;
 
+  #ifndef SIGC_TEMPLATE_SPECIALIZATION_OPERATOR_OVERLOAD
+  result_type sun_forte_workaround() const
+    { return operator(); }
+  #endif
+  
 FOR(0,CALL_SIZE,[[ADAPTOR_DO(%1)]])dnl
   /// Constructs an invalid functor.
   adaptor_functor()
Index: sigc++/adaptors/macros/bind.h.m4
===================================================================
RCS file: /cvs/gnome/libsigc++2/sigc++/adaptors/macros/bind.h.m4,v
retrieving revision 1.6
diff -u -p -r1.6 bind.h.m4
--- sigc++/adaptors/macros/bind.h.m4	13 Mar 2004 12:12:36 -0000	1.6
+++ sigc++/adaptors/macros/bind.h.m4	25 Mar 2004 20:12:03 -0000
@@ -34,10 +34,17 @@ FOR(1, eval($2-1),[
   template <LOOP([class T_arg%1], eval($2-1))>
   typename deduce_result_type<LOOP(T_arg%1,eval($2-1))>::type
   operator()(LOOP(T_arg%1 _A_arg%1,eval($2-1)))
-    { return this->functor_.LIBSIGC_TEMPLATE_PREFIX operator()<LIST(LOOP([_P_(T_arg%1)],eval($1-1)), _P_(T_bound),FOR($1,eval($2-1),[_P_(T_arg%1),]))>
+    { return this->functor_.LIBSIGC_TEMPLATE_PREFIX SIGC_WORKAROUND_OPERATOR_PARENTHESES<LIST(LOOP([_P_(T_arg%1)],eval($1-1)), _P_(T_bound),FOR($1,eval($2-1),[_P_(T_arg%1),]))>
         (LIST(LOOP(_A_arg%1,eval($1-1)), bound_, FOR($1,eval($2-1),[_A_arg%1,])));
     }
 
+  #ifndef SIGC_TEMPLATE_SPECIALIZATION_OPERATOR_OVERLOAD
+  template <LOOP([class T_arg%1], eval($2-1))>
+  typename deduce_result_type<LOOP(T_arg%1,eval($2-1))>::type
+  sun_forte_workaround(LOOP(T_arg%1 _A_arg%1,eval($2-1)))
+    { return operator()( LOOP(_A_arg%1,eval($2-1)) ); }
+  #endif
+    
 ])dnl
 ])
 define([BIND_OPERATOR_COUNT],[dnl
@@ -50,10 +57,17 @@ FOR(1, eval($2-1),[
   template <LOOP([class T_arg%1], eval($2-1))>
   typename deduce_result_type<LOOP(T_arg%1,eval($2-1))>::type
   operator()(LOOP(T_arg%1 _A_arg%1, eval($2-1)))
-    { return this->functor_.LIBSIGC_TEMPLATE_PREFIX operator()<LIST(LOOP([_P_(T_arg%1)],eval($2-1)), LOOP(_P_(T_type%1), $1))>
+    { return this->functor_.LIBSIGC_TEMPLATE_PREFIX SIGC_WORKAROUND_OPERATOR_PARENTHESES<LIST(LOOP([_P_(T_arg%1)],eval($2-1)), LOOP(_P_(T_type%1), $1))>
         (LIST(LOOP(_A_arg%1,eval($2-1)), LOOP(bound%1_, $1)));
     }
 
+  #ifndef SIGC_TEMPLATE_SPECIALIZATION_OPERATOR_OVERLOAD
+  template <LOOP([class T_arg%1], eval($2-1))>
+  typename deduce_result_type<LOOP(T_arg%1,eval($2-1))>::type
+  sun_forte_workaround(LOOP(T_arg%1 _A_arg%1, eval($2-1)))
+    { return operator()( LOOP(_A_arg%1,eval($2-1)) ); }
+  #endif
+    
 ])
 define([BIND_FUNCTOR_LOCATION],[dnl
 /** Adaptor that binds an argument to the wrapped functor.
@@ -93,7 +107,7 @@ FOR(eval($1+1),CALL_SIZE,[[BIND_OPERATOR
 template <class T_functor, class T_bound>
 typename bind_functor<$1, T_functor, T_bound>::result_type
 bind_functor<$1, T_functor, T_bound>::operator()()
-  { return this->functor_.LIBSIGC_TEMPLATE_PREFIX operator()<_P_(T_bound)> (bound_); }
+  { return this->functor_.LIBSIGC_TEMPLATE_PREFIX SIGC_WORKAROUND_OPERATOR_PARENTHESES<_P_(T_bound)> (bound_); }
 
 ])
 define([BIND_FUNCTOR_COUNT],[dnl
@@ -136,7 +150,7 @@ FOR(1,$1,[
 template <LIST(class T_functor, LOOP(class T_type%1, $1))>
 typename bind_functor<LIST(-1, T_functor, LOOP(T_type%1, $1))>::result_type
 bind_functor<LIST(-1, T_functor, LOOP(T_type%1, $1))>::operator()()
-  { return this->functor_.LIBSIGC_TEMPLATE_PREFIX operator()<LOOP(_P_(T_type%1),$1)> (LOOP(bound%1_, $1)); }
+  { return this->functor_.LIBSIGC_TEMPLATE_PREFIX SIGC_WORKAROUND_OPERATOR_PARENTHESES<LOOP(_P_(T_type%1),$1)> (LOOP(bound%1_, $1)); }
 
 /** Performs a functor on each of the targets of a functor.
  * The function overload for sigc::bind_functor performs a functor on the
Index: sigc++/adaptors/macros/bind_return.h.m4
===================================================================
RCS file: /cvs/gnome/libsigc++2/sigc++/adaptors/macros/bind_return.h.m4,v
retrieving revision 1.2
diff -u -p -r1.2 bind_return.h.m4
--- sigc++/adaptors/macros/bind_return.h.m4	13 Mar 2004 12:12:36 -0000	1.2
+++ sigc++/adaptors/macros/bind_return.h.m4	25 Mar 2004 20:12:03 -0000
@@ -21,10 +21,16 @@ include(template.macros.m4)
 define([BIND_RETURN_OPERATOR],[dnl
   template <LOOP(class T_arg%1, $1)>
   inline T_return operator()(LOOP(T_arg%1 _A_a%1, $1))
-    { this->functor_.LIBSIGC_TEMPLATE_PREFIX operator()<LOOP(_P_(T_arg%1), $1)>
+    { this->functor_.LIBSIGC_TEMPLATE_PREFIX SIGC_WORKAROUND_OPERATOR_PARENTHESES<LOOP(_P_(T_arg%1), $1)>
         (LOOP(_A_a%1, $1)); return ret_value_;
     }
 
+  #ifndef SIGC_TEMPLATE_SPECIALIZATION_OPERATOR_OVERLOAD
+  template <LOOP(class T_arg%1, $1)>
+  inline T_return sun_forte_workaround(LOOP(T_arg%1 _A_a%1, $1))
+    { return operator()( LOOP(_A_a%1, $1) ); }
+  #endif
+
 ])
 
 divert(0)dnl
Index: sigc++/adaptors/macros/compose.h.m4
===================================================================
RCS file: /cvs/gnome/libsigc++2/sigc++/adaptors/macros/compose.h.m4,v
retrieving revision 1.2
diff -u -p -r1.2 compose.h.m4
--- sigc++/adaptors/macros/compose.h.m4	13 Mar 2004 12:12:36 -0000	1.2
+++ sigc++/adaptors/macros/compose.h.m4	25 Mar 2004 20:12:03 -0000
@@ -22,7 +22,7 @@ define([COMPOSE1_OPERATOR],[dnl
   template <LOOP(class T_arg%1, $1)>
   typename deduce_result_type<LOOP(T_arg%1, $1)>::type
   operator()(LOOP(T_arg%1 _A_a%1, $1))
-    { return this->functor_.LIBSIGC_TEMPLATE_PREFIX operator()<typename sigc::deduce_result_type<LIST(T_getter, LOOP(T_arg%1,$1))>::type>
+    { return this->functor_.LIBSIGC_TEMPLATE_PREFIX SIGC_WORKAROUND_OPERATOR_PARENTHESES<typename sigc::deduce_result_type<LIST(T_getter, LOOP(T_arg%1,$1))>::type>
         (get_(LOOP(_A_a%1, $1)));
     }
 
@@ -32,7 +32,7 @@ define([COMPOSE2_OPERATOR],[dnl
   template <LOOP(class T_arg%1, $1)>
   typename deduce_result_type<LOOP(T_arg%1, $1)>::type
   operator()(LOOP(T_arg%1 _A_a%1, $1))
-    { return this->functor_.LIBSIGC_TEMPLATE_PREFIX operator()<typename sigc::deduce_result_type<LIST(T_getter1, LOOP(T_arg%1,$1))>::type,
+    { return this->functor_.LIBSIGC_TEMPLATE_PREFIX SIGC_WORKAROUND_OPERATOR_PARENTHESES<typename sigc::deduce_result_type<LIST(T_getter1, LOOP(T_arg%1,$1))>::type,
                                                          typename sigc::deduce_result_type<LIST(T_getter2, LOOP(T_arg%1,$1))>::type>
         (get1_(LOOP(_A_a%1, $1)), get2_(LOOP(_A_a%1,$1)));
     }
Index: sigc++/adaptors/macros/exception_catch.h.m4
===================================================================
RCS file: /cvs/gnome/libsigc++2/sigc++/adaptors/macros/exception_catch.h.m4,v
retrieving revision 1.2
diff -u -p -r1.2 exception_catch.h.m4
--- sigc++/adaptors/macros/exception_catch.h.m4	13 Mar 2004 12:12:36 -0000	1.2
+++ sigc++/adaptors/macros/exception_catch.h.m4	25 Mar 2004 20:12:03 -0000
@@ -25,7 +25,7 @@ define([EXCEPTION_CATCH_OPERATOR],[dnl
     { 
       try
         {
-          return this->functor_.LIBSIGC_TEMPLATE_PREFIX operator() <LOOP(_P_(T_arg%1), $1)>
+          return this->functor_.LIBSIGC_TEMPLATE_PREFIX SIGC_WORKAROUND_OPERATOR_PARENTHESES<LOOP(_P_(T_arg%1), $1)>
             (LOOP(_A_a%1, $1));
         } 
       catch (...)
Index: sigc++/adaptors/macros/hide.h.m4
===================================================================
RCS file: /cvs/gnome/libsigc++2/sigc++/adaptors/macros/hide.h.m4,v
retrieving revision 1.5
diff -u -p -r1.5 hide.h.m4
--- sigc++/adaptors/macros/hide.h.m4	13 Mar 2004 12:12:36 -0000	1.5
+++ sigc++/adaptors/macros/hide.h.m4	25 Mar 2004 20:12:03 -0000
@@ -39,6 +39,13 @@ ifelse($2,1,[dnl
   operator()(T_arg1 _A_a1)
     { return this->functor_(); }
 
+  #ifndef SIGC_TEMPLATE_SPECIALIZATION_OPERATOR_OVERLOAD
+  template <class T_arg1>
+  typename deduce_result_type<T_arg1>::type
+  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),[
@@ -49,9 +56,16 @@ FOR(1, eval($2-1),[
   template <LOOP([class T_arg%1], $2)>
   typename deduce_result_type<LOOP(T_arg%1, $2)>::type
   operator()(LOOP(T_arg%1 _A_a%1, $2))
-    { return this->functor_.LIBSIGC_TEMPLATE_PREFIX operator() <LIST(FOR(1,eval($2-1),[_P_(T_arg%1),]))>
+    { return this->functor_.LIBSIGC_TEMPLATE_PREFIX SIGC_WORKAROUND_OPERATOR_PARENTHESES<LIST(FOR(1,eval($2-1),[_P_(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)>
+  typename deduce_result_type<LOOP(T_arg%1, $2)>::type
+  sun_forte_workaround(LOOP(T_arg%1 _A_a%1, $2))
+    { return operator()( LOOP(_A_a%1, $2) ); }
+  #endif
+
 ],[dnl
   /** Invokes the wrapped functor ignoring the $1[]th argument.dnl
 FOR(1, eval($1-1),[
@@ -64,9 +78,16 @@ FOR(eval($1+1), $2,[
   template <LOOP([class T_arg%1], $2)>
   typename deduce_result_type<LOOP(T_arg%1, $2)>::type
   operator()(LOOP(T_arg%1 _A_a%1, $2))
-    { return this->functor_.LIBSIGC_TEMPLATE_PREFIX operator() <LIST(FOR(1,eval($1-1),[_P_(T_arg%1),]),FOR(eval($1+1), $2,[_P_(T_arg%1),]))>
+    { return this->functor_.LIBSIGC_TEMPLATE_PREFIX SIGC_WORKAROUND_OPERATOR_PARENTHESES<LIST(FOR(1,eval($1-1),[_P_(T_arg%1),]),FOR(eval($1+1), $2,[_P_(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)>
+  typename deduce_result_type<LOOP(T_arg%1, $2)>::type
+  sun_forte_workaround(LOOP(T_arg%1 _A_a%1, $2))
+    { return operator()( LOOP(_A_a%1, $2) ); }
+  #endif
+    
 ])])dnl
 ])
 define([HIDE_FUNCTOR],[dnl
Index: sigc++/adaptors/macros/retype.h.m4
===================================================================
RCS file: /cvs/gnome/libsigc++2/sigc++/adaptors/macros/retype.h.m4,v
retrieving revision 1.2
diff -u -p -r1.2 retype.h.m4
--- sigc++/adaptors/macros/retype.h.m4	13 Mar 2004 12:12:36 -0000	1.2
+++ sigc++/adaptors/macros/retype.h.m4	25 Mar 2004 20:12:03 -0000
@@ -21,13 +21,22 @@ include(template.macros.m4)
 define([RETYPE_OPERATOR],[dnl
 ifelse($1,0,[dnl
   result_type operator()();
+    
 ],[dnl
   template <LOOP(class T_arg%1, $1)>
   typename deduce_result_type<LOOP(T_arg%1,$1)>::type
   operator()(LOOP(T_arg%1 _A_a%1, $1))
-    { return this->functor_.LIBSIGC_TEMPLATE_PREFIX operator()<LOOP(typename type_trait<T_type%1>::take, $1)>
+    { return this->functor_.LIBSIGC_TEMPLATE_PREFIX SIGC_WORKAROUND_OPERATOR_PARENTHESES<LOOP(typename type_trait<T_type%1>::take, $1)>
         (LOOP([[(T_type%1)_A_a%1]], $1));
     }
+
+  #ifndef SIGC_TEMPLATE_SPECIALIZATION_OPERATOR_OVERLOAD
+  template <LOOP(class T_arg%1, $1)>
+  typename deduce_result_type<LOOP(T_arg%1,$1)>::type
+  sun_forte_workaround(LOOP(T_arg%1 _A_a%1, $1))
+    { return operator()( LOOP(_A_a%1, $1) ); }
+  #endif
+
 ])dnl
 ])
 define([RETYPE_POINTER_FUNCTOR],[dnl
Index: sigc++/adaptors/macros/retype_return.h.m4
===================================================================
RCS file: /cvs/gnome/libsigc++2/sigc++/adaptors/macros/retype_return.h.m4,v
retrieving revision 1.2
diff -u -p -r1.2 retype_return.h.m4
--- sigc++/adaptors/macros/retype_return.h.m4	13 Mar 2004 12:12:36 -0000	1.2
+++ sigc++/adaptors/macros/retype_return.h.m4	25 Mar 2004 20:12:03 -0000
@@ -21,18 +21,30 @@ include(template.macros.m4)
 define([RETYPE_RETURN_OPERATOR],[dnl
   template <LOOP(class T_arg%1, $1)>
   inline T_return operator()(LOOP(T_arg%1 _A_a%1, $1))
-    { return T_return(this->functor_.LIBSIGC_TEMPLATE_PREFIX operator()<LOOP(_P_(T_arg%1), $1)>
+    { return T_return(this->functor_.LIBSIGC_TEMPLATE_PREFIX SIGC_WORKAROUND_OPERATOR_PARENTHESES<LOOP(_P_(T_arg%1), $1)>
         (LOOP(_A_a%1, $1)));
     }
 
+  #ifndef SIGC_TEMPLATE_SPECIALIZATION_OPERATOR_OVERLOAD
+  template <LOOP(class T_arg%1, $1)>
+  inline T_return sun_forte_workaround(LOOP(T_arg%1 _A_a%1, $1))
+    { return operator()( LOOP(_A_a%1, $1) ); }
+  #endif
+    
 ])
 define([RETYPE_RETURN_VOID_OPERATOR],[dnl
   template <LOOP(class T_arg%1, $1)>
   inline void operator()(LOOP(T_arg%1 _A_a%1, $1))
-    { this->functor_.LIBSIGC_TEMPLATE_PREFIX operator()<LOOP(_P_(T_arg%1), $1)>
+    { this->functor_.LIBSIGC_TEMPLATE_PREFIX SIGC_WORKAROUND_OPERATOR_PARENTHESES<LOOP(_P_(T_arg%1), $1)>
         (LOOP(_A_a%1, $1));
     }
 
+  #ifndef SIGC_TEMPLATE_SPECIALIZATION_OPERATOR_OVERLOAD
+  template <LOOP(class T_arg%1, $1)>
+  inline void sun_forte_workaround(LOOP(T_arg%1 _A_a%1, $1))
+    { operator()( LOOP(_A_a%1, $1) ); }
+  #endif
+
 ])
 
 divert(0)dnl
Index: sigc++/functors/macros/slot.h.m4
===================================================================
RCS file: /cvs/gnome/libsigc++2/sigc++/functors/macros/slot.h.m4,v
retrieving revision 1.8
diff -u -p -r1.8 slot.h.m4
--- sigc++/functors/macros/slot.h.m4	27 Feb 2004 22:03:06 -0000	1.8
+++ sigc++/functors/macros/slot.h.m4	25 Mar 2004 20:12:03 -0000
@@ -180,7 +180,7 @@ FOR(1, $1,[
 ifelse($1,0,[
       return (typed_rep->functor_)();
 ],[
-      return (typed_rep->functor_).LIBSIGC_TEMPLATE_PREFIX operator()<LOOP([_R_(T_arg%1)],$1)>
+      return (typed_rep->functor_).LIBSIGC_TEMPLATE_PREFIX SIGC_WORKAROUND_OPERATOR_PARENTHESES<LOOP([_R_(T_arg%1)],$1)>
                (LOOP(a_%1, $1));
 ])dnl
     }
Index: sigc++/macros/retype.h.m4
===================================================================
RCS file: /cvs/gnome/libsigc++2/sigc++/macros/retype.h.m4,v
retrieving revision 1.2
diff -u -p -r1.2 retype.h.m4
--- sigc++/macros/retype.h.m4	13 Mar 2004 12:12:38 -0000	1.2
+++ sigc++/macros/retype.h.m4	25 Mar 2004 20:12:04 -0000
@@ -24,9 +24,16 @@ ifelse($1,0,[dnl
 ],[dnl
   template <LOOP(class T_arg%1, $1)>
   inline T_return operator()(LOOP(T_arg%1 _A_a%1, $1))
-    { return T_return(this->functor_.LIBSIGC_TEMPLATE_PREFIX operator()<LOOP(typename ::sigc::type_trait<T_type%1>::take, $1)>
+    { return T_return(this->functor_.LIBSIGC_TEMPLATE_PREFIX SIGC_WORKAROUND_OPERATOR_PARENTHESES<LOOP(typename ::sigc::type_trait<T_type%1>::take, $1)>
         (LOOP([[(T_type%1)_A_a%1]], $1)));
     }
+
+  #ifndef SIGC_TEMPLATE_SPECIALIZATION_OPERATOR_OVERLOAD
+  template <LOOP(class T_arg%1, $1)>
+  inline T_return sun_forte_workaround(LOOP(T_arg%1 _A_a%1, $1))
+    { return operator()( LOOP(_A_a%1, $1) ); }
+  #endif
+  
 ])dnl
 ])
 define([RETYPE_SLOT_VOID_OPERATOR],[dnl
@@ -35,9 +42,16 @@ ifelse($1,0,[dnl
 ],[dnl
   template <LOOP(class T_arg%1, $1)>
   inline void operator()(LOOP(T_arg%1 _A_a%1, $1))
-    { T_return(this->functor_.LIBSIGC_TEMPLATE_PREFIX operator()<LOOP(typename ::sigc::type_trait<T_type%1>::take, $1)>
+    { T_return(this->functor_.LIBSIGC_TEMPLATE_PREFIX SIGC_WORKAROUND_OPERATOR_PARENTHESES<LOOP(typename ::sigc::type_trait<T_type%1>::take, $1)>
         (LOOP([[(T_type%1)_A_a%1]], $1)));
     }
+
+  #ifndef SIGC_TEMPLATE_SPECIALIZATION_OPERATOR_OVERLOAD
+  template <LOOP(class T_arg%1, $1)>
+  inline void sun_forte_workaround(LOOP(T_arg%1 _A_a%1, $1))
+    { return operator()( LOOP(_A_a%1, $1) ); }
+  #endif
+    
 ])dnl
 ])
 define([RETYPE],[dnl


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