template class is_customly_convertible { struct str { char x[2]; }; template static char test(decltype(&C::operator())); template static str test(...); public: enum { value = sizeof(test>(0)) == sizeof(char) }; }; class NoTriviallyConstructible { public: NoTriviallyConstructible() = delete; }; class NoCopyConstructible { public: NoCopyConstructible(const NoCopyConstructible&) = delete; NoCopyConstructible& operator=(const NoCopyConstructible&) = delete; }; template<> struct Convert { int operator()(const int &a) { return a; } }; template < > struct Convert { float operator()(const int& a) { return a; } };