I am not sure if it is a problem of CUDA compiler or Visual Studio compiler or my lack of knowledge of C++. I have something like that:
template <typename T1, typename T2>
class Pair {
public:
T1 x;
T2 y;
template <int size>
class Array {
public:
T1 x;
T2 y;
};
};
template <typename T1, typename T2>
class PairVector : public Pair<T1,T2> {
public:
template <int size>
class Array : public Pair<T1,T2>::template Array < size > { //<-- this causes an error
};
};
int main() {
PairVector<int,int>::Array<5> p;
}
It fails with an error:
error C2955: ‘Pair<T1,T2>::Array’ : use of class template requires template argument list
Although the template argument list is provided!
Also I tried declaring it like this:
[...]
template <int size>
class Array : public ParentArray {
public:
typedef typename Pair<T1,T2>::template Array < size > ParentArray;
};
It ends up with an error: “not a class or struct name” during instanciation for the variable p of the main function.
Any suggestions on how to make it work?