I cannot compile the following snippet with Clang, while GCC has no problem:
template <typename T, int variant=0>struct FooCallerWrapper;template <typename T>struct FooCallerWrapper<T, 0>{ typedef int FooCallerType;};template<class SERVICE_T, int variant = 0>class FooCaller{ template<typename Dummy> struct Void { typedef void type; }; template<typename R = void, typename Enabled = void> struct EnableIfHasNextVariant { }; template<typename R> struct EnableIfHasNextVariant< R, typename Void<typename FooCallerWrapper<SERVICE_T, variant+1>::FooCallerType>::type> { typedef R type; };};FooCaller<int> foo;
I have read this question, but I cannot understand how to fix it in my case.
I tested with Clang 3.1, 8.0 and 10.0, and with GCC 5.1 and 9.3.