modified result_of for c++11
git-commit
git-author Evghenii Gaburov
[git-p4: depot-paths = "//sw/gpgpu/thrust/": change = 24246289]
MODIFY
thrust/detail/type_traits/result_of_adaptable_function.h
thrust/detail/type_traits/result_of_adaptable_function.h
@@ -30,15 +30,6 @@ namespace thrust
namespace detail
{
-#if __cplusplus >= 201103L || defined(__cpp_lib_result_of_sfinae)
-
-template<typename Signature>
- struct result_of
-{
- typedef typename std::result_of<Signature>::type type;
-};
-
-#else
template<typename Signature, typename Enable = void> struct result_of;
@@ -62,7 +53,16 @@ template<typename Functor, typename Arg1, typename Arg2>
typedef typename Functor::result_type type;
};
-#endif // __cplusplus >= 201103L
+#if __cplusplus >= 201103L || (defined(__cpp_variadic_templates) && defined(__cpp_lib_result_of_sfinae))
+
+template <typename Functor, typename... Args>
+struct result_of<Functor(Args...),
+ typename thrust::detail::enable_if<
+ !thrust::detail::has_result_type<Functor>::value>::type>
+ : std::result_of<Functor(Args...)> {};
+
+
+#endif
} // end detail
} // end thrust

modified result_of for c++11
git-commit 8878f66cf266ebbc573c562a7772ea9ec64dba76
git-author Evghenii Gaburov <egaburov@nvidia.com>

[git-p4: depot-paths = "//sw/gpgpu/thrust/": change = 24246289]