samedi 21 février 2015

Pass enum as function argument

This is a simplified example illustrating my problem. The following gives me the: error C2065: 'State' : undeclared identifier


myclass.h



class MyClass
{
enum class State { IDLE, WALK_RIGHT, WALK_LEFT };
void SetState(State);
}


myclass.cpp



#include "myclass.h"
void SetState(State state)
{
//...
}


Any idea what's wrong here? Thanks in advance!


Aucun commentaire:

Enregistrer un commentaire