2 // { dg-do compile { target c++11 } }
7 struct is_convertible_impl {
11 template<class T, class U, class = decltype(sink<U>(declval<T>()))>
12 static auto test(int) -> char;
14 template<class, class>
15 static auto test(...) -> char(&)[2];
18 template<class T, class U>
19 struct is_convertible : is_convertible_impl
21 static const bool value = sizeof(test<T, U>(0)) == 1;
28 struct enable_if<true, T> { typedef T type; };
30 template<bool, class If, class Else>
31 struct conditional { typedef If type; };
33 template<class If, class Else>
34 struct conditional<false, If, Else> { typedef Else type; };
42 static const bool value = true;
50 template<class P1, class P2>
51 struct and_<P1, P2> : conditional<P1::value, P2, P1>::type
58 class = typename enable_if<and_<is_convertible<U, T>... >::value, int>::type
63 static_assert(is_convertible<Tuple<>, Tuple<>>::value, "Ouch"); //#1