bool trouble

I have a class declare enum to hold 4 bools for movement .
1
2
3
4
5
6
7
8
9
10
11
12
13
14
 class game{
public:
	game();
	void Run();
private:
	void Process_Events();
	void handelPlayerInput(sf::Keyboard::Key ,bool );
	void Render();
	void Update();
private:
	enum Pmoving;
	sf::RenderWindow Window;
	sf::CircleShape Player;
};


this is the class

1
2
3
4
private:
//pmoving enum that stores the bools
game::Pmoving {pIsMovingUp = false,pIsMovingDown = false,
pIsMovingRight = false,pIsMovingLeft= false};


when I try to give value to them it says "enum game::pmoving inaccessible" any help.
First of all your class declaration is incorrect.
According to the C++ Standard (9.2 Class members)

1 The member-specification in a class definition declares the full set of members of the class; no member can be added elsewhere. Members of a class are data members, member functions (9.3), nested types, and enumerators.

Secondly according to paragraph #2 of section 7.2 Enumeration declarations

An opaqueenum- declaration declaring an unscoped enumeration shall not omit the enum-base.

Also if a enum is declared as private its enumerators are also private.
Topic archived. No new replies allowed.