fixed illegal template usage
authorspog <spog>
Mon, 10 Apr 2006 10:35:59 +0000 (10:35 +0000)
committerspog <spog>
Mon, 10 Apr 2006 10:35:59 +0000 (10:35 +0000)
git-svn-id: svn://svn.icculus.org/gtkradiant/GtkRadiant/trunk@47 8a3a26a2-13c4-0310-b231-cf6edde360e5

libs/generic/functional.h
libs/signal/isignal.h

index ca1d863..bd25348 100644 (file)
@@ -296,23 +296,17 @@ public:
   }
 };
 
-template<typename Type, typename Other, typename True, typename False>
+template<typename Other, typename True, typename False, typename Type>
 class TypeEqual
 {
-  template<typename Matched>
-  class Match
-  {
-  public:
-    typedef False type;
-  };
-  template<>
-  class Match<Other>
-  {
-  public:
-    typedef True type;
-  };
 public:
-  typedef typename Match<Type>::type type;
+  typedef False type;
+};
+template<typename Other, typename True, typename False>
+class TypeEqual<Other, True, False, Other>
+{
+public:
+  typedef True type;
 };
 
 
index e6cb215..4fe2747 100644 (file)
@@ -89,10 +89,10 @@ public:
   template<typename Caller>
   SignalHandler(const BindFirstOpaque<Caller>& caller)
     : Callback0<SignalHandlerResult>(BindFirstOpaque<typename TypeEqual<
-      typename Caller::result_type,
       SignalHandlerResult,
       Caller,
-      SignalHandlerCaller1<Caller>
+      SignalHandlerCaller1<Caller>,
+      typename Caller::result_type
     >::type>(caller.getBound()))
   {
   }
@@ -117,10 +117,10 @@ public:
   template<typename Caller>
   SignalHandler1(const BindFirstOpaque1<Caller>& caller)
     : Callback1<FirstArgument, SignalHandlerResult>(BindFirstOpaque1<typename TypeEqual<
-      typename Caller::result_type,
       SignalHandlerResult,
       Caller,
-      SignalHandlerCaller2<Caller>
+      SignalHandlerCaller2<Caller>,
+      typename Caller::result_type
     >::type>(caller.getBound()))
   {
   }
@@ -145,10 +145,10 @@ public:
   template<typename Caller>
   SignalHandler2(const BindFirstOpaque2<Caller>& caller)
     : Callback2<FirstArgument, SecondArgument, SignalHandlerResult>(BindFirstOpaque2<typename TypeEqual<
-      typename Caller::result_type,
       SignalHandlerResult,
       Caller,
-      SignalHandlerCaller3<Caller>
+      SignalHandlerCaller3<Caller>,
+      typename Caller::result_type
     >::type>(caller.getBound()))
   {
   }
@@ -185,10 +185,10 @@ public:
   template<typename Caller>
   SignalHandler3(const BindFirstOpaque3<Caller>& caller)
     : Callback3<FirstArgument, SecondArgument, ThirdArgument, SignalHandlerResult>(BindFirstOpaque3<typename TypeEqual<
-      typename Caller::result_type,
       SignalHandlerResult,
       Caller,
-      SignalHandlerCaller4<Caller>
+      SignalHandlerCaller4<Caller>,
+      typename Caller::result_type
     >::type>(caller.getBound()))
   {
   }