I want to know if I can split a C++ class declaration
Original class
class P
{
private:
int id;
//some really secret method
int secretMethod();
protected:
int x;
public:
P();
int getX();
};
I want to show in the .h only the public and protected method and attributes, and declare somewhere else the private, where the user of the class can't see it.
Wanted class declaration:
class P
{
protected:
int x;
public:
P();
int getX();
};
Edit: I want that for:
- I can change the implementation of the class and for the user of the class is transparent
- Is easier for the user to see less information than more
- If I change the implementation of the class, change the private atributes and method I don't want to change the .h for the user of the class