mercredi 21 avril 2021

C++ map invalid conversion from int to const LexType& (which is defined by myself in fact a int)

I defined a map like this :

std::map<std::string,LexType> lexname_s = { { "PROGRAM" , PROGRAM}}

And a LexType, like this :

typedef enum 
{
    ENDFILE,    ERROR,
    PROGRAM,    PROCEDURE,  TYPE,   VAR,        IF,
} LexType;

In Visual Studio Code, it always shows error type when I touch it.

Aucun commentaire:

Enregistrer un commentaire