m_MAX and ask() are used by run() but should otherwise not be public. How can/should this be done?
#include <vector>
class Q {
public:
static int const m_MAX=17;
int ask(){return 4;}
};
class UI {
private:
std::vector<Q*> m_list;
public:
void add(Q* a_q){m_list.push_back(a_q);}
int run(){return Q::m_MAX==m_list[0]->ask();}
};
int main()
{
UI ui;
ui.add(new Q);
ui.add(new Q);
int status = ui.run();
}
C++0x is OK.