#include <iostream>

struct S{bool operator()(){return true;}};

template <class TFunctor>
class TIsCallable
{
    typedef char TTwoChars[2];
    template <class T>
    static char Test(int[sizeof((*((T*)0))()) ? 1 : -1] = 0);

    template <class>
    static TTwoChars& Test(...);
public:
    static const bool Value_ = sizeof(Test<TFunctor>(0)) == 1;
};

int main()
{
    std::cout << TIsCallable<int>::Value_ << TIsCallable<int (*)()>::Value_
        << TIsCallable<S>::Value_ << std::endl;
}
