Re: [sigc] ANNOUNCE: libsigc++ 1.9.11



Sorry - neither Roel nor the list have received my previous mail
due to problems with the attachment. I'm attaching the patches
in a .tgz file < 8kb, now.

Regards,

  Martin

Am 2003.11.01 01:27 schrieb(en) Martin Schulze:
Hi!

Here are two patches and file sigc++/retype.h.m4. If you have
problems with the cvs checkout use these patches to update from
libsigc++-1.9.11. I also tackled the char array problem. Hopefully,
the patched version of libsigc++2 now compiles with VisualStudio.
If so, I will release libsigc++-1.9.12 which will be beta 1 at the
same time.

Regards,

  Martin


Am 2003.10.31 12:53 schrieb(en) Roel Vanhout:
Martin Schulze wrote:
Um, I should have warned you: you have edited generated files!
Most .h files are generated from equally named .h.m4 files...

Yes, I knew that, but I didn't have the guts to edit the m4 files themselves - I figured if I'd get the headers to compile, you could find out what would have to be changed to the m4 files.

Could you try to build a checkout from anoncvs tomorrow or so?

I have a checkout from gnome anoncvs, and the m4 files have the changes as you describe them, but the autogen.sh script doesn't work on the cygwin setup I have here. I have also tried it on the only Linux box I have access to (don't know the distro, has libtool 1.3.5- 1, I cannot upgrade the machine) Could someone run the autogen.sh so that everything gets into the same state it is when a release is made, and either send that to me, or put it up for download somewhere? Or is there a way I can get this to work with Cygwin? Maybe the ./autogen.sh way isn't the correct way to do it? One other thing: is it correct that you haven't added the msvc projects files directory yet?

cheers,

roel


The only problem left should be the one in test_lambda.cc now,
where the compiler doesn't want to handle char [] arrays.
(And the mysterious warnings about conversion from size_t to
unsigned short for std::cout << sig_xyz.size().)

Regards,

  Martin

> Index: sigc++/signal.h.m4
===================================================================
RCS file: /cvs/gnome/libsigc++2/sigc++/signal.h.m4,v
retrieving revision 1.15
diff -u -3 -r1.15 signal.h.m4
--- sigc++/signal.h.m4	26 Oct 2003 17:10:21 -0000	1.15
+++ sigc++/signal.h.m4	30 Oct 2003 21:01:02 -0000
@@ -342,9 +342,23 @@
   : public ::sigc::signal$1<LIST(T_return, LOOP(T_arg%1, $1),
T_accumulator)>
 {
 public:
+  typedef ::sigc::signal$1<LIST(T_return, LOOP(T_arg%1, $1),
T_accumulator)> parent_type;
+  typedef typename parent_type::result_type result_type;
+  typedef typename parent_type::slot_type slot_type;
+
   Signal$1() {}
   Signal$1(const Signal$1& src)
     : ::sigc::signal$1<LIST(T_return, LOOP(T_arg%1, $1),
T_accumulator)>(src) {}
+
+  /** Creates a functor that calls emit() on this signal.
+   * @code
+   * sigc::mem_fun(mysignal, &sigc::signal$1::emit)
+   * @endcode
+   * yields the same result.
+   * @return A functor that calls emit() on this signal.
+   */
+  slot_type slot() const
+    { return ::sigc::bound_const_mem_functor$1<LIST(LOOP(typename
::sigc::type_trait<T_arg%1>::take, $1), result_type,
parent_type)>(this, &parent_type::emit); }
 };

 ])
Index: sigc++/slot.h.m4
===================================================================
RCS file: /cvs/gnome/libsigc++2/sigc++/slot.h.m4,v
retrieving revision 1.1
diff -u -3 -r1.1 slot.h.m4
--- sigc++/slot.h.m4	26 Oct 2003 17:10:21 -0000	1.1
+++ sigc++/slot.h.m4	30 Oct 2003 21:01:02 -0000
@@ -119,7 +119,7 @@
  *
  * This ugly hack avoids the error:
  */
-#define slot(...) make_slot(__VA_ARGS__)
+// #define slot(...) make_slot(__VA_ARGS__)
 #endif


Index: sigc++/adaptors/adaptor_trait.h.m4
===================================================================
RCS file: /cvs/gnome/libsigc++2/sigc++/adaptors/adaptor_trait.h.m4,v
retrieving revision 1.11
diff -u -3 -r1.11 adaptor_trait.h.m4
--- sigc++/adaptors/adaptor_trait.h.m4	19 Oct 2003 15:27:28
-0000	1.11
+++ sigc++/adaptors/adaptor_trait.h.m4	30 Oct 2003 21:01:04
-0000
@@ -102,7 +102,13 @@
 #include <sigc++/functors/mem_fun.h>
 #include <sigc++/adaptors/deduce_result_type.h>

-namespace sigc {
+namespace sigc {
+
+#ifdef MSVC
+#define LIBSIGC_TEMPLATE_PREFIX
+#else
+#define LIBSIGC_TEMPLATE_PREFIX template
+#endif

 template <class T_functor> struct adapts;

Index: sigc++/adaptors/bind.h.m4
===================================================================
RCS file: /cvs/gnome/libsigc++2/sigc++/adaptors/bind.h.m4,v
retrieving revision 1.14
diff -u -3 -r1.14 bind.h.m4
--- sigc++/adaptors/bind.h.m4	26 Oct 2003 17:10:23
-0000	1.14
+++ sigc++/adaptors/bind.h.m4	30 Oct 2003 21:01:04 -0000
@@ -36,7 +36,7 @@
   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 functor_.template operator()<LIST(LOOP([_P_(T_arg%1)],
eval($2-1)),
_P_(T_bound))>
+    { return functor_.LIBSIGC_TEMPLATE_PREFIX
operator()<LIST(LOOP([_P_(T_arg%1)],eval($2-1)), _P_(T_bound))>
         (LIST(LOOP(_A_arg%1,eval($2-1)), bound_));
     }

@@ -44,7 +44,7 @@
   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 functor_.template operator()<LIST(LOOP([_P_(T_arg%1)],
eval($1-1)),
_P_(T_bound),FOR($1,eval($2-1),[_P_(T_arg%1),]))>
+    { return 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),]))>
         (LIST(LOOP(_A_arg%1,eval($1-1)),
bound_,FOR($1,eval($2-1),[_A_arg%1,])));
     }

@@ -80,7 +80,7 @@
 template <class T_bound, class T_functor>
 typename bind_functor<$1, T_bound, T_functor>::result_type
 bind_functor<$1, T_bound, T_functor>::operator()()
-  { return functor_.template operator()<_P_(T_bound)> (bound_); }
+  { return functor_.LIBSIGC_TEMPLATE_PREFIX operator()<_P_(T_bound)>
(bound_); }

 ])

@@ -141,20 +141,20 @@
 bind(const T_functor& _A_functor, T_bound1 _A_b1, T_bound2 _A_b2)
 {
   return bind_functor<I_location, typename
unwrap_reference<T_bound1>::type,
-         bind_functor<(I_location?I_location+1:0), typename
unwrap_reference<T_bound2>::type, T_functor> >
-           (bind<(I_location?I_location+1:0)>(_A_functor, _A_b2),
_A_b1);
+         bind_functor<I_location?I_location+1:0, typename
unwrap_reference<T_bound2>::type, T_functor> >
+           (bind<I_location?I_location+1:0>(_A_functor, _A_b2),
_A_b1);
 }

 template <int I_location, class T_bound1, class T_bound2, class
T_bound3, class T_functor>
 inline bind_functor<I_location, typename
unwrap_reference<T_bound1>::type,
-       bind_functor<(I_location?I_location+1:0), typename
unwrap_reference<T_bound2>::type,
-       bind_functor<(I_location?I_location+2:0), typename
unwrap_reference<T_bound3>::type, T_functor> > >
+       bind_functor<I_location?I_location+1:0, typename
unwrap_reference<T_bound2>::type,
+       bind_functor<I_location?I_location+2:0, typename
unwrap_reference<T_bound3>::type, T_functor> > >
 bind(const T_functor& _A_functor, T_bound1 _A_b1, T_bound2
_A_b2,T_bound3 _A_b3)
 {
   return bind_functor<I_location, typename
unwrap_reference<T_bound1>::type,
-         bind_functor<(I_location?I_location+1:0), typename
unwrap_reference<T_bound2>::type,
-         bind_functor<(I_location?I_location+2:0), typename
unwrap_reference<T_bound3>::type, T_functor> > >
-           (bind<(I_location?I_location+1:0)>(_A_functor, _A_b2,
_A_b3),_A_b1);
+         bind_functor<I_location?I_location+1:0, typename
unwrap_reference<T_bound2>::type,
+         bind_functor<I_location?I_location+2:0, typename
unwrap_reference<T_bound3>::type, T_functor> > >
+           (bind<I_location?I_location+1:0>(_A_functor, _A_b2,
_A_b3),_A_b1);
 }

 } /* namespace sigc */
Index: sigc++/adaptors/bind_return.h.m4
===================================================================
RCS file: /cvs/gnome/libsigc++2/sigc++/adaptors/bind_return.h.m4,v
retrieving revision 1.9
diff -u -3 -r1.9 bind_return.h.m4
--- sigc++/adaptors/bind_return.h.m4	25 Oct 2003 22:49:03
-0000	1.9
+++ sigc++/adaptors/bind_return.h.m4	30 Oct 2003 21:01:04 -0000
@@ -21,7 +21,7 @@
 define([BIND_RETURN_OPERATOR],[dnl
   template <LOOP(class T_arg%1, $1)>
   inline T_return operator()(LOOP(T_arg%1 _A_a%1, $1))
-    { functor_.template operator()<LOOP(_P_(T_arg%1), $1)>
+    { functor_.LIBSIGC_TEMPLATE_PREFIX operator()<LOOP(_P_(T_arg%1),
$1)>
         (LOOP(_A_a%1, $1)); return ret_value_;
     }

Index: sigc++/adaptors/compose.h.m4
===================================================================
RCS file: /cvs/gnome/libsigc++2/sigc++/adaptors/compose.h.m4,v
retrieving revision 1.11
diff -u -3 -r1.11 compose.h.m4
--- sigc++/adaptors/compose.h.m4	20 Oct 2003 20:12:31
-0000	1.11
+++ sigc++/adaptors/compose.h.m4	30 Oct 2003 21:01:04 -0000
@@ -22,7 +22,7 @@
   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 functor_.template operator()<typename
sigc::deduce_result_type<LIST(T_getter, LOOP(T_arg%1,$1))>::type>
+    { return functor_.LIBSIGC_TEMPLATE_PREFIX operator()<typename
sigc::deduce_result_type<LIST(T_getter, LOOP(T_arg%1,$1))>::type>
         (get_(LOOP(_A_a%1, $1)));
     }

@@ -32,8 +32,8 @@
   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 functor_.template operator()<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>
+    { return functor_.LIBSIGC_TEMPLATE_PREFIX operator()<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/exception_catch.h.m4
===================================================================
RCS file: /cvs/gnome/libsigc++2/sigc++/adaptors/exception_catch.h.m4,
v
retrieving revision 1.10
diff -u -3 -r1.10 exception_catch.h.m4
--- sigc++/adaptors/exception_catch.h.m4	20 Oct 2003 18:27:59
-0000	1.10
+++ sigc++/adaptors/exception_catch.h.m4	30 Oct 2003 21:01:05
-0000
@@ -25,7 +25,7 @@
     {
       try
         {
-          return functor_.template operator() <LOOP(_P_(T_arg%1),
$1)>
+          return functor_.LIBSIGC_TEMPLATE_PREFIX operator()
<LOOP(_P_(T_arg%1), $1)>
             (LOOP(_A_a%1, $1));
         }
       catch (...)
Index: sigc++/adaptors/hide.h.m4
===================================================================
RCS file: /cvs/gnome/libsigc++2/sigc++/adaptors/hide.h.m4,v
retrieving revision 1.11
diff -u -3 -r1.11 hide.h.m4
--- sigc++/adaptors/hide.h.m4	20 Oct 2003 18:27:59
-0000	1.11
+++ sigc++/adaptors/hide.h.m4	30 Oct 2003 21:01:05 -0000
@@ -39,14 +39,14 @@
   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 functor_.template operator()
<LIST(FOR(1,eval($2-1),[_P_(T_arg%1),]))>
+    { return functor_.LIBSIGC_TEMPLATE_PREFIX operator()
<LIST(FOR(1,eval($2-1),[_P_(T_arg%1),]))>
         (LIST(FOR(1,eval($2-1),[_A_a%1,]))); }

 ],[dnl
   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 functor_.template operator()
<LIST(FOR(1,eval($1-1),[_P_(T_arg%1),]),FOR(eval($1+1),
$2,[_P_(T_arg%1),]))>
+    { return functor_.LIBSIGC_TEMPLATE_PREFIX operator()
<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,]))); }

 ])])dnl
@@ -94,7 +94,7 @@
 namespace sigc {

 template <int I_location, class T_functor>
-class hide_functor;
+struct hide_functor;

 FOR(0,CALL_SIZE,[[HIDE_FUNCTOR(%1)]])dnl

Index: sigc++/adaptors/retype_return.h.m4
===================================================================
RCS file: /cvs/gnome/libsigc++2/sigc++/adaptors/retype_return.h.m4,v
retrieving revision 1.1
diff -u -3 -r1.1 retype_return.h.m4
--- sigc++/adaptors/retype_return.h.m4	25 Oct 2003 22:49:03
-0000	1.1
+++ sigc++/adaptors/retype_return.h.m4	30 Oct 2003 21:01:05
-0000
@@ -21,7 +21,7 @@
 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(functor_.template operator()<LOOP(_P_(T_arg%
1),
$1)>
+    { return T_return(functor_.LIBSIGC_TEMPLATE_PREFIX
operator()<LOOP(_P_(T_arg%1), $1)>
         (LOOP(_A_a%1, $1)));
     }

@@ -29,7 +29,7 @@
 define([RETYPE_RETURN_VOID_OPERATOR],[dnl
   template <LOOP(class T_arg%1, $1)>
   inline void operator()(LOOP(T_arg%1 _A_a%1, $1))
-    { functor_.template operator()<LOOP(_P_(T_arg%1), $1)>
+    { functor_.LIBSIGC_TEMPLATE_PREFIX operator()<LOOP(_P_(T_arg%1),
$1)>
         (LOOP(_A_a%1, $1));
     }

Index: sigc++/adaptors/lambda/base.h.m4
===================================================================
RCS file: /cvs/gnome/libsigc++2/sigc++/adaptors/lambda/base.h.m4,v
retrieving revision 1.13
diff -u -3 -r1.13 base.h.m4
--- sigc++/adaptors/lambda/base.h.m4	24 Oct 2003 23:27:29
-0000	1.13
+++ sigc++/adaptors/lambda/base.h.m4	30 Oct 2003 21:01:05 -0000
@@ -21,7 +21,7 @@
   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_.template operator()<LOOP(_P_(T_arg%1), $1)>
+    { return value_.LIBSIGC_TEMPLATE_PREFIX
operator()<LOOP(_P_(T_arg%1), $1)>
              (LOOP(_A_%1, $1));
     }

Index: sigc++/adaptors/lambda/operator.h.m4
===================================================================
RCS file: /cvs/gnome/libsigc++2/sigc++/adaptors/lambda/operator.h.m4,
v
retrieving revision 1.15
diff -u -3 -r1.15 operator.h.m4
--- sigc++/adaptors/lambda/operator.h.m4	25 Oct 2003 22:49:06
-0000	1.15
+++ sigc++/adaptors/lambda/operator.h.m4	30 Oct 2003 21:01:07
-0000
@@ -27,9 +27,9 @@
       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_.template operator()<LOOP(_P_(T_arg%1), $1)>
+        (arg1_.LIBSIGC_TEMPLATE_PREFIX operator()<LOOP(_P_(T_arg%1),
$1)>
             (LOOP(_A_%1, $1)),
-         arg2_.template operator()<LOOP(_P_(T_arg%1), $1)>
+         arg2_.LIBSIGC_TEMPLATE_PREFIX operator()<LOOP(_P_(T_arg%1),
$1)>
             (LOOP(_A_%1, $1)));
     }

@@ -41,7 +41,7 @@
     {
       return lambda_action_unary<T_action>::template do_action<
             typename deduce_result_type<LOOP(T_arg%1,$1)>::
operand_type>
-        (arg_.template operator()<LOOP(_P_(T_arg%1), $1)>
+        (arg_.LIBSIGC_TEMPLATE_PREFIX operator()<LOOP(_P_(T_arg%1),
$1)>
             (LOOP(_A_%1, $1)));
     }

@@ -53,7 +53,7 @@
     {
       return lambda_action_convert<T_action, T_type>::template
do_action<
             typename deduce_result_type<LOOP(T_arg%1,$1)>::
operand_type>
-        (arg_.template operator()<LOOP(_P_(T_arg%1), $1)>
+        (arg_.LIBSIGC_TEMPLATE_PREFIX operator()<LOOP(_P_(T_arg%1),
$1)>
             (LOOP(_A_%1, $1)));
     }

Index: tests/test_accumulated.cc
===================================================================
RCS file: /cvs/gnome/libsigc++2/tests/test_accumulated.cc,v
retrieving revision 1.2
diff -u -3 -r1.2 test_accumulated.cc
--- tests/test_accumulated.cc	19 Oct 2003 15:27:32
-0000	1.2
+++ tests/test_accumulated.cc	30 Oct 2003 21:01:10 -0000
@@ -23,8 +23,8 @@
     }
 };

-int foo(int i)   { std::cout << "foo: " << 3*i+1 << std::endl; return
3*i+1;}
-int bar(float i) { std::cout << "bar: " << 5*(int)i-3 << std::endl;
return 5*(int)i-3;}
+int foo(int i)    { std::cout << "foo: " << 3*i+1 << std::endl;
return 3*i+1;}
+int bar(double i) { std::cout << "bar: " << 5*(int)i-3 << std::endl;
return 5*(int)i-3;}

 struct A : public sigc::trackable
 {
Index: tests/test_bind.cc
===================================================================
RCS file: /cvs/gnome/libsigc++2/tests/test_bind.cc,v
retrieving revision 1.9
diff -u -3 -r1.9 test_bind.cc
--- tests/test_bind.cc	24 Oct 2003 23:27:30 -0000	1.9
+++ tests/test_bind.cc	30 Oct 2003 21:01:10 -0000
@@ -6,6 +6,7 @@
 #include <sigc++/adaptors/bind.h>
 #include <sigc++/functors/slot.h>
 #include <iostream>
+#include <string>

 struct foo : public sigc::functor_base
 {
@@ -99,6 +100,4 @@
     std::cout << (std::string&)guest_book << std::endl;
   }    // auto-disconnect
   sl(); // :-)
-
-  const bool b1 = sigc::is_base_and_derived<sigc::trackable, void
(*)(std::string&)>::value;
 }
Index: tests/test_bind_return.cc
===================================================================
RCS file: /cvs/gnome/libsigc++2/tests/test_bind_return.cc,v
retrieving revision 1.5
diff -u -3 -r1.5 test_bind_return.cc
--- tests/test_bind_return.cc	25 Oct 2003 22:49:10
-0000	1.5
+++ tests/test_bind_return.cc	30 Oct 2003 21:01:10 -0000
@@ -6,6 +6,7 @@
 #include <sigc++/adaptors/bind_return.h>
 #include <sigc++/functors/slot.h>
 #include <iostream>
+#include <string>

 struct foo
 {
@@ -31,11 +32,11 @@
   sigc::bind_return<std::string&>(foo(),str)(6) = "main";
   std::cout << str << std::endl;

-  sigc::slot<bar,int> c; // bar, not bar&: slots cannot return
references
+  sigc::slot<bar,int> sl; // bar, not bar&: slots cannot return
references
   {
     bar choco(-1);
-    c = sigc::bind_return(foo(),sigc::ref(choco));
-    std::cout << c(7) << std::endl;
+    sl = sigc::bind_return(foo(),sigc::ref(choco));
+    std::cout << sl(7) << std::endl;
   } // auto-disconnect
-  std::cout << c(8) << std::endl;
+  std::cout << sl(8) << std::endl;
 }
Index: tests/test_compose.cc
===================================================================
RCS file: /cvs/gnome/libsigc++2/tests/test_compose.cc,v
retrieving revision 1.5
diff -u -3 -r1.5 test_compose.cc
--- tests/test_compose.cc	19 Oct 2003 15:27:32 -0000	1.5
+++ tests/test_compose.cc	30 Oct 2003 21:01:10 -0000
@@ -17,23 +17,23 @@
   typedef int result_type;
   int operator()(int i)
     {std::cout << "set(int "<<i<<")"<<std::endl; return i*i;}
-  float operator()(float i)
-    {std::cout << "set(float "<<i<<")"<<std::endl; return i*5;}
+  double operator()(double i)
+    {std::cout << "set(double "<<i<<")"<<std::endl; return i*5;}
 #else
   // choose a type that can hold all return values
-  typedef float result_type;
-  float operator()(int i)
+  typedef double result_type;
+  double operator()(int i)
     {std::cout << "set(int "<<i<<")"<<std::endl; return i*i;}
-  float operator()(float i)
-    {std::cout << "set(float "<<i<<")"<<std::endl; return i*5;}
+  double operator()(double i)
+    {std::cout << "set(double "<<i<<")"<<std::endl; return i*5;}
 #endif
 };

 struct set_void
 {
   typedef void result_type;
-  void operator()(float i)
-    { std::cout << "set_void(float "<<i<<")"<<std::endl; }
+  void operator()(double i)
+    { std::cout << "set_void(double "<<i<<")"<<std::endl; }
 };

 struct get
@@ -43,17 +43,17 @@
     { std::cout << "get()"<<std::endl; return true; }
   int operator()(int i)
     { std::cout << "get("<<i<<")"<<std::endl; return i*2; }
-  float operator()(int i,int j)
-    { std::cout << "get("<<i<<","<<j<<")"<<std::endl; return
float(i)/float(j); }
+  double operator()(int i,int j)
+    { std::cout << "get("<<i<<","<<j<<")"<<std::endl; return
double(i)/double(j); }
 #else
   // choose a type that can hold all return values
-  typedef float result_type;
-  float operator()()
+  typedef double result_type;
+  double operator()()
     { std::cout << "get()"<<std::endl; return true; }
-  float operator()(int i)
+  double operator()(int i)
     { std::cout << "get("<<i<<")"<<std::endl; return i*2; }
-  float operator()(int i,int j)
-    { std::cout << "get("<<i<<","<<j<<")"<<std::endl; return
float(i)/float(j); }
+  double operator()(int i,int j)
+    { std::cout << "get("<<i<<","<<j<<")"<<std::endl; return
double(i)/double(j); }
 #endif
 };

Index: tests/test_disconnect.cc
===================================================================
RCS file: /cvs/gnome/libsigc++2/tests/test_disconnect.cc,v
retrieving revision 1.4
diff -u -3 -r1.4 test_disconnect.cc
--- tests/test_disconnect.cc	19 Oct 2003 15:27:32
-0000	1.4
+++ tests/test_disconnect.cc	30 Oct 2003 21:01:11 -0000
@@ -10,8 +10,8 @@
 #include <sigc++/functors/mem_fun.h>
 #include <iostream>

-int foo(int i) { std::cout << "foo: " << i << std::endl; return 1;}
-int bar(float i) { std::cout << "bar: " << i << std::endl; return 1;}
+int foo(int i)    { std::cout << "foo: " << i << std::endl; return
1;}
+int bar(double i) { std::cout << "bar: " << i << std::endl; return
1;}

 struct A : public sigc::trackable
 {
Index: tests/test_signal.cc
===================================================================
RCS file: /cvs/gnome/libsigc++2/tests/test_signal.cc,v
retrieving revision 1.3
diff -u -3 -r1.3 test_signal.cc
--- tests/test_signal.cc	19 Oct 2003 15:27:32 -0000	1.3
+++ tests/test_signal.cc	30 Oct 2003 21:01:12 -0000
@@ -8,6 +8,7 @@
 #include <sigc++/functors/ptr_fun.h>
 #include <sigc++/functors/mem_fun.h>
 #include <iostream>
+#include <string>

 int foo(int i)   {std::cout << "foo(int "<<i<<")" << std::endl;
return 1;}
 int bar(float i) {std::cout << "bar(float "<<i<<")" << std::endl;
return 1;}
Index: tests/test_slot.cc
===================================================================
RCS file: /cvs/gnome/libsigc++2/tests/test_slot.cc,v
retrieving revision 1.3
diff -u -3 -r1.3 test_slot.cc
--- tests/test_slot.cc	25 Oct 2003 22:49:10 -0000	1.3
+++ tests/test_slot.cc	30 Oct 2003 21:01:12 -0000
@@ -3,8 +3,9 @@
  *  Assigned to public domain.  Use as you wish without restriction.
  */

-#include <iostream>
 #include <sigc++/functors/slot.h>
+#include <iostream>
+#include <string>

 class foo
 {
Index: tests/test_trackable.cc
===================================================================
RCS file: /cvs/gnome/libsigc++2/tests/test_trackable.cc,v
retrieving revision 1.3
diff -u -3 -r1.3 test_trackable.cc
--- tests/test_trackable.cc	19 Oct 2003 15:27:32
-0000	1.3
+++ tests/test_trackable.cc	30 Oct 2003 21:01:12 -0000
@@ -6,7 +6,7 @@
 #include <iostream>
 #include <sigc++/trackable.h>
 #include <sigc++/functors/slot.h>
-#include <sigc++/adaptors/bind.h>
+//#include <sigc++/adaptors/bind.h>
 #include <sigc++/functors/mem_fun.h>

 class my_class: public sigc::trackable

Index: sigc++/type_traits.h
===================================================================
RCS file: /cvs/gnome/libsigc++2/sigc++/type_traits.h,v
retrieving revision 1.6
diff -u -3 -r1.6 type_traits.h
--- sigc++/type_traits.h	20 Oct 2003 18:27:59 -0000	1.6
+++ sigc++/type_traits.h	1 Nov 2003 00:04:29 -0000
@@ -33,6 +33,16 @@
   static  T_type  instance(); /* not implemented */
 };

+template <class T_type, int N>
+struct type_trait<T_type[N]>
+{
+  typedef T_type*  type;
+  typedef T_type*& pass;
+  typedef const T_type*& take;
+  typedef T_type** pointer;
+  static  T_type*  instance(); /* not implemented */
+};
+
 template <class T_type>
 struct type_trait<T_type&>
 {
Index: sigc++/visit_each.h
===================================================================
RCS file: /cvs/gnome/libsigc++2/sigc++/visit_each.h,v
retrieving revision 1.6
diff -u -3 -r1.6 visit_each.h
--- sigc++/visit_each.h	25 Oct 2003 22:49:02 -0000	1.6
+++ sigc++/visit_each.h	1 Nov 2003 00:04:29 -0000
@@ -35,23 +35,14 @@
   template <bool I_derived, class T_type> struct with_type;

   template <class T_type> struct with_type<false,T_type>
-  {
-    static void execute_(T_type&, const T_self&) {}
-    static void execute_(const T_type&, const T_self&) {}
-  };
+  { static void execute_(const T_type&, const T_self&) {} };

   template <class T_type> struct with_type<true,T_type>
-  {
-    static void execute_(T_type& _A_type, const T_self& _A_action)
-      { _A_action.action_(_A_type); }
-    static void execute_(const T_type& _A_type, const T_self&
_A_action)
+  { static void execute_(const T_type& _A_type, const T_self&
_A_action)
       { _A_action.action_(_A_type); }
   };

   template <class T_type>
-  void operator()(T_type& _A_type) const
-  { with_type<is_base_and_derived<T_target,T_type>::value,T_type>::
execute_(_A_type,*this);
}
-  template <class T_type>
   void operator()(const T_type& _A_type) const
   { with_type<is_base_and_derived<T_target,T_type>::value,T_type>::
execute_(_A_type,*this);
}

@@ -69,22 +60,13 @@
   template <bool I_derived, class T_type> struct with_type;

   template <class T_type> struct with_type<false,T_type>
-  {
-    static void execute_(T_type&, const T_self&) {}
-    static void execute_(const T_type&, const T_self&) {}
-  };
+  { static void execute_(const T_type&, const T_self&) {} };

   template <class T_type> struct with_type<true,T_type>
-  {
-    static void execute_(T_type& _A_type, const T_self& _A_action)
-     { _A_action.action_(&_A_type); }
-    static void execute_(const T_type& _A_type, const T_self&
_A_action)
+  { static void execute_(const T_type& _A_type, const T_self&
_A_action)
      { _A_action.action_(&_A_type); }
   };

-  template <class T_type>
-  void operator()(T_type& _A_type) const
-  { with_type<is_base_and_derived<T_target,T_type>::value,T_type>::
execute_(_A_type,*this);
}
   template <class T_type>
   void operator()(const T_type& _A_type) const
   { with_type<is_base_and_derived<T_target,T_type>::value,T_type>::
execute_(_A_type,*this);
}
Index: sigc++/adaptors/deduce_result_type.h.m4
===================================================================
RCS file: /cvs/gnome/libsigc++2/sigc++/adaptors/deduce_result_type.h.
m4,v
retrieving revision 1.2
diff -u -3 -r1.2 deduce_result_type.h.m4
--- sigc++/adaptors/deduce_result_type.h.m4	19 Oct 2003
15:27:28 -0000	1.2
+++ sigc++/adaptors/deduce_result_type.h.m4	1 Nov 2003 00:04:29
-0000
@@ -23,16 +23,17 @@
   { typedef typename T_functor::deduce_result_type<LOOP(T_arg%1,$1)
>::type
type; };

 ])
-define([DEDUCE_RESULT_TYPE_TYPEOF],[dnl
-template <LIST(class T_functor, LOOP(class T_arg%1, $1))>
-struct deduce_result_type<LIST(T_functor, LOOP(T_arg%1,$1),
LOOP(void,eval($2-$1)), false)>
-{
-  typedef typeof(type_trait<T_functor>::instance().
-                   T_functor::operator()(LOOP([
-                      type_trait<T_arg%1>::instance()], $1))) type;
-};
-
-])
+dnl 01.11.2003: Completely removed support for typeof() since it is
non-standard!
+dnl define([DEDUCE_RESULT_TYPE_TYPEOF],[dnl
+dnl template <LIST(class T_functor, LOOP(class T_arg%1, $1))>
+dnl struct deduce_result_type<LIST(T_functor, LOOP(T_arg%1,$1),
LOOP(void,eval($2-$1)), false)>
+dnl {
+dnl   typedef typeof(type_trait<T_functor>::instance().
+dnl                    T_functor::operator()(LOOP([
+dnl                       type_trait<T_arg%1>::instance()], $1)))
type;
+dnl };
+dnl
+dnl ])

 divert(0)dnl
 /*
@@ -53,12 +54,11 @@
  * typename deduce_result_type<functor_type, [list of
arg_types]>::type
  * can be used to infer a functor's return type at compile time if
the
  * argument types are known.
- * If the compiler supports typeof() it is used to deduce the result
type
- * the functor. Otherwise, typename
functor_trait<functor_type>::result_type
- * is used. This gives the correct return type if functor_type
inherits from
+ * It defaults to typename functor_trait<functor_type>::result_type.
+ * This gives the correct return type if functor_type inherits from
  * sigc::functor::functor_base and defines result_type or if
functor_type
- * is actually a (member) function type. Mulit-type functors are only
- * supported when typeof() is available.
+ * is actually a (member) function type. Mulit-type functors are not
+ * supported.
  * sigc++ adaptors define a class member deduce_result_type<> that is
  * used by the global deduce_result_type<> template to correctly
deduce
  * the return types of the different template operator() overloads.
@@ -76,10 +76,10 @@
 struct deduce_result_type
   { typedef typename functor_trait<T_functor>::result_type type; };

-FOR(0,CALL_SIZE,[[DEDUCE_RESULT_TYPE_ADAPTOR(%1,CALL_SIZE)]])
-
-#ifdef SIGC_CXX_TYPEOF
-FOR(0,CALL_SIZE,[[DEDUCE_RESULT_TYPE_TYPEOF(%1,CALL_SIZE)]])
-#endif
+FOR(0,CALL_SIZE,[[DEDUCE_RESULT_TYPE_ADAPTOR(%1,CALL_SIZE)]])dnl

+dnl #ifdef SIGC_CXX_TYPEOF
+dnl FOR(0,CALL_SIZE,[[DEDUCE_RESULT_TYPE_TYPEOF(%1,CALL_SIZE)]])
+dnl #endif
+dnl
 } /* namespace sigc */
Index: sigc++/adaptors/lambda/operator.h.m4
===================================================================
RCS file: /cvs/gnome/libsigc++2/sigc++/adaptors/lambda/operator.h.m4,
v
retrieving revision 1.16
diff -u -3 -r1.16 operator.h.m4
--- sigc++/adaptors/lambda/operator.h.m4	30 Oct 2003 21:08:55
-0000	1.16
+++ sigc++/adaptors/lambda/operator.h.m4	1 Nov 2003 00:04:31
-0000
@@ -64,11 +64,12 @@
dnl (http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=10243)
 dnl       E.g. typeof(type_trait<std::ostream&>::instance() <<
type_trait<int>::instance())
 dnl                 == std::ostream  //(instead of std::ostream&)
-#ifdef SIGC_CXX_TYPEOF
-template <class T_test1, class T_test2>
-struct lambda_action_deduce_result_type<$1, T_test1, T_test2>
-  { typedef typeof(type_trait<T_test1>::instance() $2
type_trait<T_test2>::instance()) type; };
-#endif
+dnl 01.11.2003: Completely removed support for typeof() since it is
non-standard!
+dnl #ifdef SIGC_CXX_TYPEOF
+dnl template <class T_test1, class T_test2>
+dnl struct lambda_action_deduce_result_type<$1, T_test1, T_test2>
+dnl   { typedef typeof(type_trait<T_test1>::instance() $2
type_trait<T_test2>::instance()) type; };
+dnl #endif
 divert(1)dnl
 template <>
 struct lambda_action<$1 >
@@ -105,11 +106,12 @@
dnl (http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=10243)
 dnl       E.g. typeof(type_trait<std::ostream&>::instance() <<
type_trait<int>::instance())
 dnl                 == std::ostream  //(instead of std::ostream&)
-#ifdef SIGC_CXX_TYPEOF
-template <class T_test>
-struct lambda_action_unary_deduce_result_type<$1, T_test>
-  { typedef typeof($2 type_trait<T_test>::instance()) type; };
-#endif
+dnl 01.11.2003: Completely removed support for typeof() since it is
non-standard!
+dnl #ifdef SIGC_CXX_TYPEOF
+dnl template <class T_test>
+dnl struct lambda_action_unary_deduce_result_type<$1, T_test>
+dnl   { typedef typeof($2 type_trait<T_test>::instance()) type; };
+dnl #endif
 divert(1)dnl
 template <>
 struct lambda_action_unary<$1 >
@@ -136,11 +138,12 @@
dnl (http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=10243)
 dnl       E.g. typeof(type_trait<std::ostream&>::instance() <<
type_trait<int>::instance())
 dnl                 == std::ostream  //(instead of std::ostream&)
-#ifdef SIGC_CXX_TYPEOF
-template <class T_type, class T_test>
-struct lambda_action_convert_deduce_result_type<$1, T_type, T_test>
-  { typedef typeof($2<T_type>(type_trait<T_test>::instance())) type;
};
-#endif
+dnl 01.11.2003: Completely removed support for typeof() since it is
non-standard!
+dnl #ifdef SIGC_CXX_TYPEOF
+dnl template <class T_type, class T_test>
+dnl struct lambda_action_convert_deduce_result_type<$1, T_type,
T_test>
+dnl   { typedef typeof($2<T_type>(type_trait<T_test>::instance()))
type; };
+dnl #endif
 divert(1)dnl
 template <class T_type>
 struct lambda_action_convert<$1, T_type>
@@ -268,85 +271,85 @@
 struct lambda_action_deduce_result_type
   { typedef typename type_trait<T_test1>::type type; }; // TODO: e.
g.
T_test1=int, T_test2=double yields int but it should yield double !

-#ifdef SIGC_CXX_TYPEOF
-template <class T_action, class T_test1>
-struct lambda_action_deduce_result_type<T_action, T_test1, void>
-  { typedef void type; };
-template <class T_action, T_test2>
-struct lambda_action_deduce_result_type<T_action, void, T_test2>
-  { typedef void type; };
-template <class T_action>
-struct lambda_action_deduce_result_type<T_action, void, void>
-  { typedef void type; };
-#endif
-
-#ifndef SIGC_CXX_TYPEOF
+dnl #ifdef SIGC_CXX_TYPEOF
+dnl template <class T_action, class T_test1>
+dnl struct lambda_action_deduce_result_type<T_action, T_test1, void>
+dnl   { typedef void type; };
+dnl template <class T_action, T_test2>
+dnl struct lambda_action_deduce_result_type<T_action, void, T_test2>
+dnl   { typedef void type; };
+dnl template <class T_action>
+dnl struct lambda_action_deduce_result_type<T_action, void, void>
+dnl   { typedef void type; };
+dnl #endif
+dnl
+dnl #ifndef SIGC_CXX_TYPEOF
 template <class T_action, class T_test1, class T_test2>
 struct lambda_action_deduce_result_type<logical<T_action>, T_test1,
T_test2>
   { typedef bool type; };
-#endif
+dnl #endif

-#ifndef SIGC_CXX_TYPEOF
+dnl #ifndef SIGC_CXX_TYPEOF
 template <class T_action, class T_test1, class T_test2>
 struct lambda_action_deduce_result_type<relational<T_action>,
T_test1, T_test2>
   { typedef bool type; };
-#endif
+dnl #endif

-#ifndef SIGC_CXX_TYPEOF
+dnl #ifndef SIGC_CXX_TYPEOF
 template <class T_action, class T_test1, class T_test2>
 struct lambda_action_deduce_result_type<arithmetic_assign<T_action>,
T_test1, T_test2>
   { typedef T_test1 type; };
-#endif
+dnl #endif

-#ifndef SIGC_CXX_TYPEOF
+dnl #ifndef SIGC_CXX_TYPEOF
 template <class T_action, class T_test1, class T_test2>
 struct lambda_action_deduce_result_type<bitwise_assign<T_action>,
T_test1, T_test2>
   { typedef T_test1 type; };
-#endif
+dnl #endif

-#ifndef SIGC_CXX_TYPEOF
+dnl #ifndef SIGC_CXX_TYPEOF
 template <class T_test1, class T_test2>
 struct lambda_action_deduce_result_type<other<subscript>, T_test1,
T_test2>
   { typedef typename type_trait<typename
dereference_trait<T_test1>::type>::pass type; };
-#endif
+dnl #endif

 template <class T_action, class T_test>
 struct lambda_action_unary_deduce_result_type
   { typedef typename type_trait<T_test>::type type; };

-#ifdef SIGC_CXX_TYPEOF
-template <class T_action>
-struct lambda_action_unary_deduce_result_type<T_action, void>
-  { typedef void type; };
-#endif
-
+dnl #ifdef SIGC_CXX_TYPEOF
+dnl template <class T_action>
+dnl struct lambda_action_unary_deduce_result_type<T_action, void>
+dnl   { typedef void type; };
+dnl #endif
+dnl
 template <class T_action, class T_type, class T_test>
 struct lambda_action_convert_deduce_result_type
   { typedef typename type_trait<T_type>::type type; };

-#ifdef SIGC_CXX_TYPEOF
-template <class T_action, class T_test>
-struct lambda_action_convert_deduce_result_type<T_action, void,
T_test>
-  { typedef void type; };
-#endif
-
-#ifndef SIGC_CXX_TYPEOF
+dnl #ifdef SIGC_CXX_TYPEOF
+dnl template <class T_action, class T_test>
+dnl struct lambda_action_convert_deduce_result_type<T_action, void,
T_test>
+dnl   { typedef void type; };
+dnl #endif
+dnl
+dnl #ifndef SIGC_CXX_TYPEOF
 template <class T_action, class T_test>
struct lambda_action_unary_deduce_result_type<unary_logical<T_action>,
T_test>
   { typedef bool type; };
-#endif
+dnl #endif

-#ifndef SIGC_CXX_TYPEOF
+dnl #ifndef SIGC_CXX_TYPEOF
 template <class T_test>
 struct lambda_action_unary_deduce_result_type<unary_other<address>,
T_test>
   { typedef typename type_trait<T_test>::pointer type; };
-#endif
+dnl #endif

-#ifndef SIGC_CXX_TYPEOF
+dnl #ifndef SIGC_CXX_TYPEOF
 template <class T_test>
struct lambda_action_unary_deduce_result_type<unary_other<dereference>,
T_test>
   { typedef typename type_trait<typename
dereference_trait<T_test>::type>::pass type; };
-#endif
+dnl #endif

 LAMBDA_OPERATOR(arithmetic<plus>,+)
 LAMBDA_OPERATOR(arithmetic<minus>,-)
@@ -376,12 +379,12 @@
 LAMBDA_OPERATOR(bitwise_assign<and_>,&=)
 LAMBDA_OPERATOR(bitwise_assign<or_>,|=)
 LAMBDA_OPERATOR(bitwise_assign<xor_>,^=)dnl
-
-#ifdef SIGC_CXX_TYPEOF
-template <class T_test1, class T_test2>
-struct lambda_action_deduce_result_type<other<subscript>, T_test1,
T_test2>
-  { typedef typeof(type_trait<T_test1>::instance()
[[type_trait<T_test2>::instance()]])
type; };
-#endif
+dnl
+dnl #ifdef SIGC_CXX_TYPEOF
+dnl template <class T_test1, class T_test2>
+dnl struct lambda_action_deduce_result_type<other<subscript>,
T_test1, T_test2>
+dnl   { typedef typeof(type_trait<T_test1>::instance()
[[type_trait<T_test2>::instance()]])
type; };
+dnl #endif
 divert(1)dnl
 template <>
 struct lambda_action<other<subscript> >
@@ -393,12 +396,12 @@
 };

 divert(0)dnl
-
-#ifdef SIGC_CXX_TYPEOF
-template <class T_test1, class T_test2>
-struct lambda_action_deduce_result_type<other<assign>, T_test1,
T_test2>
-  { typedef typeof(type_trait<T_test1>::instance() =
type_trait<T_test2>::instance()) type; };
-#endif
+dnl
+dnl #ifdef SIGC_CXX_TYPEOF
+dnl template <class T_test1, class T_test2>
+dnl struct lambda_action_deduce_result_type<other<assign>, T_test1,
T_test2>
+dnl   { typedef typeof(type_trait<T_test1>::instance() =
type_trait<T_test2>::instance()) type; };
+dnl #endif
 divert(1)dnl
 template <>
 struct lambda_action<other<assign> >
Index: sigc++/functors/functor_trait.h.m4
===================================================================
RCS file: /cvs/gnome/libsigc++2/sigc++/functors/functor_trait.h.m4,v
retrieving revision 1.5
diff -u -3 -r1.5 functor_trait.h.m4
--- sigc++/functors/functor_trait.h.m4	23 Oct 2003 19:08:53
-0000	1.5
+++ sigc++/functors/functor_trait.h.m4	1 Nov 2003 00:04:31
-0000
@@ -65,10 +65,11 @@
   result_type is defined in all user defined or 3rd-party functors
   (except those you specify a return type explicitly with
SIGC_FUNCTOR_TRAIT()).

-  You might get away without these conventions if your compiler
supports
-  typeof() and if you don't happen to use the operator()() overload
of
-  sigc++'s adaptors in your program.
-
+dnl 01.11.2003: Completely removed support for typeof() since it is
non-standard!
+dnl   You might get away without these conventions if your compiler
supports
+dnl   typeof() and if you don't happen to use the operator()()
overload of
+dnl   sigc++'s adaptors in your program.
+dnl
 */
 __FIREWALL__
 #include <sigc++/type_traits.h>
Index: tests/test_bind.cc
===================================================================
RCS file: /cvs/gnome/libsigc++2/tests/test_bind.cc,v
retrieving revision 1.10
diff -u -3 -r1.10 test_bind.cc
--- tests/test_bind.cc	30 Oct 2003 21:08:56 -0000	1.10
+++ tests/test_bind.cc	1 Nov 2003 00:04:34 -0000
@@ -10,17 +10,6 @@

 struct foo : public sigc::functor_base
 {
-#ifdef SIGC_CXX_TYPEOF
-  // if the compiler supports typeof(), result_type must only match
the
-  // return type of the operator() overload with 1 argument (cannot
be auto-detected in C++).
-  typedef bool result_type;
-  bool operator()(int i)
-    {std::cout << "foo(int "<<i<<")" << std::endl; return (i>0);}
-  int operator()(int i,int j)
-    {std::cout << "foo(int "<<i<<",int "<<j<<")" << std::endl; return
i+j;}
-  void operator()(int i,int j,int k)
-    {std::cout << "foo(int "<<i<<",int "<<j<<", int "<<k<<")" <<
std::endl;}
-#else
   // choose a type that can hold all return values
   typedef int result_type;
   int operator()(int i)
@@ -29,7 +18,6 @@
     {std::cout << "foo(int "<<i<<",int "<<j<<")" << std::endl; return
i+j;}
   int operator()(int i,int j,int k)
     {std::cout << "foo(int "<<i<<",int "<<j<<", int "<<k<<")" <<
std::endl; return 0;}
-#endif
 };

 struct foo_void : public sigc::functor_base
Index: tests/test_compose.cc
===================================================================
RCS file: /cvs/gnome/libsigc++2/tests/test_compose.cc,v
retrieving revision 1.6
diff -u -3 -r1.6 test_compose.cc
--- tests/test_compose.cc	30 Oct 2003 21:08:56 -0000	1.6
+++ tests/test_compose.cc	1 Nov 2003 00:04:35 -0000
@@ -11,22 +11,12 @@

 struct set
 {
-#ifdef SIGC_CXX_TYPEOF
-  // if the compiler supports typeof(), result_type must only match
the
-  // return type of set's operator()(int) overload (cannot be
auto-detected in C++).
-  typedef int result_type;
-  int operator()(int i)
-    {std::cout << "set(int "<<i<<")"<<std::endl; return i*i;}
-  double operator()(double i)
-    {std::cout << "set(double "<<i<<")"<<std::endl; return i*5;}
-#else
   // choose a type that can hold all return values
   typedef double result_type;
   double operator()(int i)
     {std::cout << "set(int "<<i<<")"<<std::endl; return i*i;}
   double operator()(double i)
     {std::cout << "set(double "<<i<<")"<<std::endl; return i*5;}
-#endif
 };

 struct set_void
Index: tests/test_exception_catch.cc
===================================================================
RCS file: /cvs/gnome/libsigc++2/tests/test_exception_catch.cc,v
retrieving revision 1.4
diff -u -3 -r1.4 test_exception_catch.cc
--- tests/test_exception_catch.cc	19 Oct 2003 15:27:32
-0000	1.4
+++ tests/test_exception_catch.cc	1 Nov 2003 00:04:35 -0000
@@ -7,14 +7,9 @@
 #include <iostream>
 #include <stdexcept>

-#ifndef SIGC_CXX_TYPEOF
 struct f : public sigc::functor_base
 {
   typedef int result_type;
-#else
-struct f
-{
-#endif
   int operator()(int i)
     {std::cout << "f(int "<<i<<")"<<std::endl;
      throw std::range_error("out of range");}
@@ -22,8 +17,6 @@

 struct g : public sigc::functor_base
 {
-  // also necessary if the compiler supports typeof() because the
return type of
-  // g's operator() overload with no arguments cannot be
auto-detected in C++:
   typedef int result_type;
   int operator()()
     {std::cout << "g()"<<std::endl;
Index: tests/test_hide.cc
===================================================================
RCS file: /cvs/gnome/libsigc++2/tests/test_hide.cc,v
retrieving revision 1.4
diff -u -3 -r1.4 test_hide.cc
--- tests/test_hide.cc	19 Oct 2003 15:27:32 -0000	1.4
+++ tests/test_hide.cc	1 Nov 2003 00:04:35 -0000
@@ -8,22 +8,12 @@

 struct foo : public sigc::functor_base
 {
-#ifdef SIGC_CXX_TYPEOF
-  // if the compiler supports typeof(), result_type must only match
the
-  // return type of foo's operator() overload with no arguments
(cannot be auto-detected in C++).
-  typedef bool result_type;
-  bool operator()()
-    {std::cout << "foo()"<<std::endl; return true;}
-  int operator()(int j)
-    {std::cout << "foo(int "<<j<<")"<<std::endl; return 1+j;}
-#else
   // choose a type that can hold all return values
   typedef int result_type;
   int operator()()
     {std::cout << "foo()"<<std::endl; return true;}
   int operator()(int j)
     {std::cout << "foo(int "<<j<<")"<<std::endl; return 1+j;}
-#endif
 };

 struct foo_void : public sigc::functor_base
Index: tests/test_lambda.cc
===================================================================
RCS file: /cvs/gnome/libsigc++2/tests/test_lambda.cc,v
retrieving revision 1.10
diff -u -3 -r1.10 test_lambda.cc
--- tests/test_lambda.cc	25 Oct 2003 22:49:10 -0000	1.10
+++ tests/test_lambda.cc	1 Nov 2003 00:04:35 -0000
@@ -16,7 +16,6 @@
 using sigc::_6;
 using sigc::_7;

-#ifndef SIGC_CXX_TYPEOF
 // other template libraries (e.g. boost::lambda) have similar hacks
built in
 // to make lambda shift operators work with streams
 namespace sigc {
@@ -26,7 +25,6 @@
   typedef std::ostream& type;
 };
 }
-#endif

 int foo(int i, int j)
   {std::cout << "foo(int "<<i<<", int "<<j<<")" << std::endl; return
4*i+j;}

dnl Copyright 2003, The libsigc++ Development Team
dnl
dnl This library is free software; you can redistribute it and/or
dnl modify it under the terms of the GNU Lesser General Public
dnl License as published by the Free Software Foundation; either
dnl version 2.1 of the License, or (at your option) any later version.

dnl
dnl This library is distributed in the hope that it will be useful,
dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
dnl Lesser General Public License for more details.
dnl
dnl You should have received a copy of the GNU Lesser General Public
dnl License along with this library; if not, write to the Free
Software
dnl Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA
dnl
divert(-1)

include(template.macros.m4)

define([RETYPE_SLOT_OPERATOR],[dnl
ifelse($1,0,[dnl
  T_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(functor_.LIBSIGC_TEMPLATE_PREFIX
operator()<LOOP(typename ::sigc::type_trait<T_type%1>::take, $1)>
        (LOOP([[(T_type%1)_A_a%1]], $1)));
    }
])dnl
])
define([RETYPE_SLOT_VOID_OPERATOR],[dnl
ifelse($1,0,[dnl
  void operator()();
],[dnl
  template <LOOP(class T_arg%1, $1)>
  inline void operator()(LOOP(T_arg%1 _A_a%1, $1))
    { T_return(functor_.LIBSIGC_TEMPLATE_PREFIX
operator()<LOOP(typename ::sigc::type_trait<T_type%1>::take, $1)>
        (LOOP([[(T_type%1)_A_a%1]], $1)));
    }
])dnl
])
define([RETYPE],[dnl
template <LIST(class T_return, LOOP(class T_arg%1, $1), class T_ret,
LOOP(class T_type%1, $1))>
inline Slot$1<LIST(T_return, LOOP(T_arg%1, $1))>
retype(const Slot$1<LIST(T_ret, LOOP(T_type%1, $1))>& _A_slot)
{ return Slot$1<LIST(T_return, LOOP(T_arg%1, $1))>
    (retype_slot_functor<LIST(Slot$1<LIST(T_ret, LOOP(T_type%1, $1))
>,
T_return, LOOP(T_type%1, $1))>
      (_A_slot)); }

])

divert(0)dnl
__FIREWALL__
#include <sigc++/adaptors/adaptor_trait.h>
#include <sigc++/slot.h>

#ifndef LIBSIGC_DISABLE_DEPRECATED

namespace SigC {

template <LIST(class T_functor, class T_return, LOOP(class
T_type%1=::sigc::nil, CALL_SIZE))>
struct retype_slot_functor
  : public ::sigc::adapts<T_functor>
{
  template <LOOP(class T_arg%1=void, CALL_SIZE)>
  struct deduce_result_type
    { typedef T_return type; };
  typedef T_return result_type;

  T_return operator()();

FOR(1,CALL_SIZE,[[RETYPE_SLOT_OPERATOR(%1)]])dnl

  retype_slot_functor(typename ::sigc::type_trait<T_functor>::take
_A_functor)
    : ::sigc::adapts<T_functor>(_A_functor)
    {}
};

template <LIST(class T_functor, class T_return, LOOP(class T_type%1,
CALL_SIZE))>
T_return retype_slot_functor<LIST(T_functor, T_return, LOOP(T_type%1,
CALL_SIZE))>::operator()()
  { return T_return(functor_()); }


// void specialization needed because of explicit cast to T_return
template <LIST(class T_functor, LOOP(class T_type%1, CALL_SIZE))>
struct retype_slot_functor<LIST(T_functor, void, LOOP(T_type%1,
CALL_SIZE))>
  : public ::sigc::adapts<T_functor>
{
  template <LOOP(class T_arg%1=void, CALL_SIZE)>
  struct deduce_result_type
    { typedef void type; };
  typedef void result_type;

  void operator()();

FOR(1,CALL_SIZE,[[RETYPE_SLOT_VOID_OPERATOR(%1)]])dnl

  retype_slot_functor(typename ::sigc::type_trait<T_functor>::take
_A_functor)
    : ::sigc::adapts<T_functor>(_A_functor)
    {}
};

template <LIST(class T_functor, LOOP(class T_type%1, CALL_SIZE))>
void retype_slot_functor<LIST(T_functor, void, LOOP(T_type%1,
CALL_SIZE))>::operator()()
  { functor_(); }


template <LIST(class T_action, class T_functor, class T_return,
LOOP(class T_type%1, CALL_SIZE))>
void visit_each(const T_action& _A_action,
                const retype_slot_functor<LIST(T_functor, T_return,
LOOP(T_type%1, CALL_SIZE))>& _A_target)
{
  visit_each(_A_action, _A_target.functor_);
}


FOR(0,CALL_SIZE,[[RETYPE(%1)]])dnl

} /* namespace SigC */

#endif /* LIBSIGC_DISABLE_DEPRECATED */

Attachment: libsigc++-1.9.11-patch.tgz
Description: application/compressed-tar



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