[libsigc++2] exception_catch.h: Generate deduce_result_type for the void specializations too.



commit 0c03f942eb5ad987919303008edbd13c1f7d6941
Author: Murray Cumming <murrayc murrayc com>
Date:   Fri Aug 14 22:35:55 2015 +0200

    exception_catch.h: Generate deduce_result_type for the void specializations too.
    
    I guess this is correct and test_exception_catch still passes.
    Without this, it's actually using, for instance:
      sigc::deduce_result_type<T_arg1, T_Arg2>
    even though sigc::deduce_result_type<> should really be called with a result type
    first, like so:
      sigc::deduce_result_type<T_return, T_arg1, T_Arg2>
    
    Explicitly changing it to use
      sigc::deduce_result_type<T_return, T_Arg1, T_Arg2>
    or
      sigc::deduce_result_type<T_Arg1, T_Arg2>
    instead of just
      deduce_result_type<T_Arg1, T_Arg2>
    doesn't seem to break things either, probably out of luck,
    but changing it to define a type that it actually seems to expect seems
    cleaner, and makes it easier for us to change sigc::deduce_result_type.

 sigc++/adaptors/macros/exception_catch.h.m4 |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)
---
diff --git a/sigc++/adaptors/macros/exception_catch.h.m4 b/sigc++/adaptors/macros/exception_catch.h.m4
index f94581f..5f5cd10 100644
--- a/sigc++/adaptors/macros/exception_catch.h.m4
+++ b/sigc++/adaptors/macros/exception_catch.h.m4
@@ -131,6 +131,12 @@ struct exception_catch_functor<T_functor, T_catcher, void> : public adapts<T_fun
   typedef void result_type;
   typedef typename adapts<T_functor>::adaptor_type adaptor_type;
 
+#ifndef DOXYGEN_SHOULD_SKIP_THIS
+  template <LOOP(class T_arg%1=void, CALL_SIZE)>
+  struct deduce_result_type
+    { typedef typename adaptor_type::template deduce_result_type<LOOP(_P_(T_arg%1),CALL_SIZE)>::type type; };
+#endif
+
   void
   operator()();
 


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