#include <iostream>

template <class W, class T>
void foo(W& a, T& t)
{
	std::cout << "generic" << std::endl;
}

template <class W>
void foo(W& a, int& t)
{
	std::cout << "int" << std::endl;
}

template <template <bool> class W, class T>
void foo(W<true>& a, const T& t)
{
	::foo(a, const_cast<T&>(t));
}

template <bool> struct what;
template<> struct what<true> { };

int main() {
	const int ci = 10;
	what<true> wt;

	foo(wt, ci);

	return 0;
}