2 // { dg-do compile { target c++11 } }
4 template <typename T> T&& declval();
6 template<typename T1, typename T2, typename... Args>
10 typedef struct {char _m[2]; } two;
12 template<typename U1, typename U2, typename... Args2>
13 static decltype(declval<U1>().construct(declval<U2*>(), declval<Args2>()...), one()) test(int);
14 template<typename, typename, typename...>
17 static const bool value = sizeof(test<T1, T2, Args...>(0)) == 1;
26 void construct(int*, int);
29 template<typename _Tp>
32 template<typename _Tp1, typename... _Args>
33 void construct(_Tp1*, _Args&&...) {}
36 #define SA(X) static_assert(X,#X)
37 SA((!has_construct<A0, int, int>::value)); // ok
38 SA((has_construct<A1, int, int>::value)); // bang
39 SA((has_construct<A2<int>, int>::value)); // bang