(First, apologies if my use of terms is not correct/standard, I hope it is sufficient to get the gist... pointers welcome to fix title/wording!)
Overview of goal
The Class will inherit template-name
specialised for every type in the list.
Implementation
The non-valid C++ code is essentially as follows (I make this valid in the next snippet under GCC)
/// NOTE: The example is not complete... just to abbreviate the Godbolt example
template<typename Type>
struct TemplateName
{};
template<typename TemplateName, typename... Types>
class HandleAllTypeImpl<TemplateName, std::tuple<Types...> >
: public TemplateName<Datas>...
{};
To make this valid the TemplateName
must be a full type so I made a dummy container type and then can use TemplateName::Impl
to access and instantiate the templated member
/// NOTE: The example is not complete... just to abbreviate the Godbolt example
struct TemplateName
{
template<typename Type>
struct Impl
{};
}
template<typename TemplateName, typename... Types>
class HandleAllTypeImpl<TemplateName, std::tuple<Types...> >
: public TemplateName::Impl<Datas>...
{};
Full example - works under GCC, fails under MSVC
https://godbolt.org/z/898hE8MhY
MSVC error reported
The error is reported on the use of TemplateName::Impl<Datas>
as
error C2143: syntax error: missing ',' before '<'