Здравствуйте, Videoman, Вы писали:
Как вариант.
Возможны и другие в зависимости от потребностей.
// struct std::true_type { operator bool const() { return true; } }
// struct std::false_type { operator bool const() { return true; } }
template<class T, class Enable = void>
struct has_some_tag : std::false_type {};
template<class T>
struct has_some_tag<T, typename enable_if_type<typename T::some_tag>::type> : std::true_type
{};
template<typename T>
void FImpl(T const& t, std::true_type) {}
template<typename T>
void FImpl(T const& t, std::false_type) {}
template<typename T>
void F(T const& t)
{
FImpl(t, has_some_tag<T>());
}
http://stackoverflow.com/a/9644512/558098