Say that in file foo.h I have:
enum bar {
ONE = 1,
TWO
};
class foo {
bar m_bar;
public:
void setBar(bar arg){ m_bar = arg; }
bar getBar() const { return m_bar; }
};
In my current design, the only persistent bar
variable will be m_bar
. But I will have other functions, outside of foo
that contain a bar
, for example a GUI class that creates a local bar
and passes it to setBar
.
So here's my question, is there any rationale to defining bar
publicly inside foo
versus just inside the class where it is?