I declared an enum (called Direction) in a header file:
enum Direction {LEFT, RIGHT};
Then, i have a constructor that takes a Direction value and set it for another Direction variable (stringDirection).
bool InformationWidget::move(Direction direction){
stringDirection=direction;
return true;
}
And finally, i have an if statement that checks the value of it:
if (stringDirection == Direction::RIGHT)
This is where i'm getting the error, at that if statement.. any ideas? I tried looking around at previous threads but didn't find anything useful.
Thanks!
EDIT:
Here are my files:
Widget.h
enum class Direction {LEFT, RIGHT};
class Widget {
public:
virtual bool...
...
};
information.h
class InformationWidget: public Widget {
public:
...
Direction stringDirection;
...
};
information.cpp
void InformationWidget::show(){
...
if (stringDirection == LEFT) {
... }
}