1 // { dg-do compile { target c++11 } }
2 template<typename Signature>
3 struct function_traits;
5 template<typename R, typename... ArgTypes>
6 struct function_traits<R(ArgTypes...)> {
10 template<typename R, typename Class, typename... ArgTypes>
11 struct function_traits<R (Class::*)(ArgTypes...)> {
12 typedef R result_type;
15 template<typename R, typename Class, typename... ArgTypes>
16 struct function_traits<R (Class::*)(ArgTypes...) const> {
17 typedef R result_type;
20 template<typename T, typename U>
22 static const bool value = false;
26 struct same_type<T, T> {
27 static const bool value = true;
32 int a0[same_type<function_traits<int (X::*)()>::result_type, int>::value? 1 : -1];
33 int a1[same_type<function_traits<int (X::*)(float)>::result_type, int>::value? 1 : -1];
34 int a2[same_type<function_traits<int (X::*)(double, char)>::result_type, int>::value? 1 : -1];
35 int a3[same_type<function_traits<int (X::*)(double, char) const>::result_type, int>::value? 1 : -1];