#include <iostream>
#include <algorithm>
#include <list>
#include <vector>
#include <deque>
template <typename T, template <typename, typename...> class Container, typename... Args>
static bool contained(const T & x, const Container<T, Args...> & xs)
{
std::cout << __PRETTY_FUNCTION__ << '\n';
return std::find(xs.begin(),xs.end(),x) != xs.end();
}
int main()
{
std::list<int> lst;
std::vector<double> vec;
std::deque<char> deq;
contained(1, lst);
contained(2.1, vec);
contained('z', deq);
}
I2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8YWxnb3JpdGhtPgojaW5jbHVkZSA8bGlzdD4KI2luY2x1ZGUgPHZlY3Rvcj4KI2luY2x1ZGUgPGRlcXVlPgoKdGVtcGxhdGUgPHR5cGVuYW1lIFQsIHRlbXBsYXRlIDx0eXBlbmFtZSwgdHlwZW5hbWUuLi4+IGNsYXNzIENvbnRhaW5lciwgdHlwZW5hbWUuLi4gQXJncz4Kc3RhdGljIGJvb2wgY29udGFpbmVkKGNvbnN0IFQgJiB4LCBjb25zdCBDb250YWluZXI8VCwgQXJncy4uLj4gJiB4cykKewogICAgc3RkOjpjb3V0IDw8IF9fUFJFVFRZX0ZVTkNUSU9OX18gPDwgJ1xuJzsKICAgIHJldHVybiBzdGQ6OmZpbmQoeHMuYmVnaW4oKSx4cy5lbmQoKSx4KSAhPSB4cy5lbmQoKTsKfQoKaW50IG1haW4oKQp7CiAgICBzdGQ6Omxpc3Q8aW50PiBsc3Q7CiAgICBzdGQ6OnZlY3Rvcjxkb3VibGU+IHZlYzsKICAgIHN0ZDo6ZGVxdWU8Y2hhcj4gZGVxOwogICAgCiAgICBjb250YWluZWQoMSwgbHN0KTsKICAgIGNvbnRhaW5lZCgyLjEsIHZlYyk7CiAgICBjb250YWluZWQoJ3onLCBkZXEpOwp9
bool contained(const T&, const Container<T, Args ...>&) [with T = int; Container = std::list; Args = {std::allocator<int>}]
bool contained(const T&, const Container<T, Args ...>&) [with T = double; Container = std::vector; Args = {std::allocator<double>}]
bool contained(const T&, const Container<T, Args ...>&) [with T = char; Container = std::deque; Args = {std::allocator<char>}]