#include <iostream>
using namespace std;
 
template<typename T, typename = int>
struct HasHelloFunction : std::false_type {};
 
template<typename T>
struct HasHelloFunction<T, decltype((void)T::hello(), 0)> : std::true_type {};
 
struct Works
{
	static int hello() {}
};
 
struct Works2
{
	static void hello() {}
};
 
struct DoesntWork
{
    static int hello; // close but not callable
};
 
int main() {
 
	cout << "char: " << HasHelloFunction<char>::value << endl;
	cout << "Works: " << HasHelloFunction<Works>::value << endl;
	cout << "Works2: " << HasHelloFunction<Works2>::value << endl;
	cout << "DoesntWork: " << HasHelloFunction<DoesntWork>::value << endl;
	cout << "int: " << HasHelloFunction<int>::value << endl;
 
	return 0;
}