mardi 28 avril 2015

Accessing nested template class of the template base class in a template derived class [duplicate]

This question already has an answer here:

The code below results in a compile-time error: A<T>::PortIdxType is not a type when compiled using gcc 4.9.1. Is there a way to access a nested template member class of template base class in the template derived class?

template<typename T>
class A
{
public:
    template<int N> struct PortIdxType{};
};


template<typename T>
class B: public A<T>
{
public:

    using A<T>::A;

    template<int N>
    void getter(A<T>::PortIdxType<N> q)
        {}
};

Aucun commentaire:

Enregistrer un commentaire