I want to pass a partial template specialization to template template parameter but I'm getting an error. Im not sure why excatly this doesent work.
template<template<typename, int> class V, typename T, int N, int... Indexes>
class Swizzle
{
// ...
};
template<typename T, int N>
struct Vector;
template<typename T>
struct Vector<T, 3>
{
// ...
union
{
// ...
Swizzle<Vector, T, 3, 0, 0, 0> xxx;
};
};
Error:
'Vector': invalid template argument for template parameter 'V', expected a class template 'Swizzle': use of class template requires template argument list
Problem appears only on MSVC
Within the class template Vector, Vector refers to both the type of this instance of the template and the template itself.
This should compile:
template<class X, int M>
using Self = Vector<X,M>;
// ...
union
{
// ...
Swizzle<Self, T, 3, 0, 0, 0> xxx;
};
I suspect MSVC is wrong here, but am uncertain.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With