diff options
Diffstat (limited to 'libstdc++-v3/include/std/type_traits')
-rw-r--r-- | libstdc++-v3/include/std/type_traits | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/libstdc++-v3/include/std/type_traits b/libstdc++-v3/include/std/type_traits index 42a462e53a5..f4d0b267759 100644 --- a/libstdc++-v3/include/std/type_traits +++ b/libstdc++-v3/include/std/type_traits @@ -307,21 +307,27 @@ namespace std { }; template<typename _From, typename _To, - bool = (is_void<_From>::value || is_void<_To>::value - || is_function<_To>::value || is_array<_To>::value)> + bool = (is_void<_From>::value || is_function<_To>::value + || is_array<_To>::value)> struct __is_convertible_helper - { static const bool __value = (is_void<_From>::value - && is_void<_To>::value); }; + { static const bool __value = is_void<_To>::value; }; template<typename _From, typename _To> class __is_convertible_helper<_From, _To, false> : public __sfinae_types { - static __one __test(_To); - static __two __test(...); + template<typename _To1> + static void __test_aux(_To1); + + template<typename _From1, typename _To1> + static decltype(__test_aux<_To1>(std::declval<_From1>()), __one()) + __test(int); + + template<typename, typename> + static __two __test(...); public: - static const bool __value = sizeof(__test(declval<_From>())) == 1; + static const bool __value = sizeof(__test<_From, _To>(0)) == 1; }; /// is_convertible |