In an attempt to use SFINAE, the following code fails to compile:
template<typename ObjectType, typename GroupA, typename GroupB, typename = void>
struct DelegateImpl; // default version
template<typename ObjectType, typename GroupA, typename GroupB>
struct DelegateImpl<ObjectType, GroupA, GroupB, decltype(GroupA::get<ObjectType>())>; // specialization
With GCC:
error: template argument 4 is invalid
With MSVC, a surprisingly more helpful:
error C3553: decltype expects an expression not a type
My aim is to have the compiler pick the specialization if the expression GroupA::get<ObjectType>()
is valid.
Question: How do I use decltype with a static template method?