2 // { dg-do compile { target c++11 } }
4 template <class T, T v>
5 struct integral_constant { };
8 template<bool b, typename Int>
9 void operator()(integral_constant<bool,b>, Int i) {
13 template<bool...Bs, typename F, typename ...T>
14 auto dispatch(F f, T...t) -> decltype(f(integral_constant<bool,Bs>()..., t...)) {
15 return f(integral_constant<bool,Bs>()..., t...);
18 template<bool...Bs, typename F, typename ...T>
19 auto dispatch(F f, bool b, T...t) -> decltype(dispatch<Bs..., true>(f, t...)) {
21 return dispatch<Bs..., true>(f, t...);
23 return dispatch<Bs..., false>(f, t...);
27 dispatch(f(), true, 5);