1

My code describes two classes that implement simple enum defined in class "a" and function "getNum" that uses the enum and i get the following comilation errors:

1."C2061: syntax error: identifier 'Etry
2."C4346: 'a<T>::Etry': dependent name is not a type

The code:

a class:

template <typename T>
class a

{

public:

enum Etry
{
    AAA,
    BBB,
    CCC
};

a()
{
    printf("\nconstructor of a class.\n");
};

};

b class:

template <typename T>
class b
{
public:

    void getNum(int num, a<T>::Etry enumParam)
    {
        printf("\nbla bla....\n");
    }

    b() {
        printf("\nconstructor of b class.\n");
    }
};

Why did I get the errors?

Drew Steen
  • 16,045
  • 12
  • 62
  • 90
user11001
  • 372
  • 3
  • 14

0 Answers0