I’d like to do a generic function which will be specialized with some types, but I also would like to specialized with templated types, which is not allowed by the compiler. Is there a way to get around this ?
Ideal not working implementation:
template<class D> class Dummy{public: D val;};
template<typename T> T foo();
template<> int foo<int>()
{
return 0;
}
template<typename D> Dummy<D> foo<Dummy<D>>()
{
return Dummy<D>{};
}
I get the error non-class, non-variable partial specialization ‘foo<Dummy<D> >’ is not allowed