template<typename T> bool in_list(T x, T v) { return x == v; } template<typename T, typename... Args> bool in_list(T x, T first, Args... args) { return x == first || in_list(x, args...); }