[libsigc++2] C++11: deduce_result_type: build fix, using SFINAE paradigm.



commit 39930d6772896f43ab75374c598270b44969d577
Author: Marcin Kolny <marcin kolny gmail com>
Date:   Sat Aug 15 08:47:16 2015 +0200

    C++11: deduce_result_type: build fix, using SFINAE paradigm.
    
    Bug #753612

 sigc++/adaptors/macros/deduce_result_type.h.m4 |   13 +++++++------
 1 files changed, 7 insertions(+), 6 deletions(-)
---
diff --git a/sigc++/adaptors/macros/deduce_result_type.h.m4 b/sigc++/adaptors/macros/deduce_result_type.h.m4
index 8e5557e..f83347f 100644
--- a/sigc++/adaptors/macros/deduce_result_type.h.m4
+++ b/sigc++/adaptors/macros/deduce_result_type.h.m4
@@ -65,12 +65,13 @@ struct adaptor_base : public functor_base {};
 template<class T_functor, class... T_args>
 struct deduce_result_type
 {
-  using type =
-    typename std::conditional<
-      std::is_base_of<adaptor_base, T_functor>::value,
-      typename T_functor::template deduce_result_type<T_args...>::type,
-      typename functor_trait<T_functor>::result_type
-    >::type;
+  template<class U, typename=typename std::is_same<typename std::is_base_of<adaptor_base, T_functor>::type, 
std::true_type>::type>
+  static typename U::template deduce_result_type<T_args...> test (int);
+
+  template<class U>
+  static typename functor_trait<T_functor>::result_type test (...);
+
+  using type = decltype (test<T_functor> (0));
 };
 
 template<typename T_functor, typename... T_args>


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