| 1 |
// { dg-do compile { target c++11 } } |
| 2 |
template<typename Signature> |
| 3 |
struct function_traits; |
| 4 |
|
| 5 |
template<typename R, typename... ArgTypes> |
| 6 |
struct function_traits<R(ArgTypes...)> { |
| 7 |
typedef R result_type; |
| 8 |
}; |
| 9 |
|
| 10 |
template<typename T, typename U> |
| 11 |
struct same_type { |
| 12 |
static const bool value = false; |
| 13 |
}; |
| 14 |
|
| 15 |
template<typename T> |
| 16 |
struct same_type<T, T> { |
| 17 |
static const bool value = true; |
| 18 |
}; |
| 19 |
|
| 20 |
int a0[same_type<function_traits<int()>::result_type, int>::value? 1 : -1]; |
| 21 |
int a1[same_type<function_traits<int(float)>::result_type, int>::value? 1 : -1]; |
| 22 |
int a2[same_type<function_traits<int(double, char)>::result_type, int>::value? 1 : -1]; |