I'm learning C++ while working on a GUI for my console based program.
I have one class 'Tab' which so far has a single constructor that takes no arguments and builds the layout I specified.
I want to use the same class and build a different layout by calling a different constructor. This is what I had in mind:
Code:
int main(int argc, char **argv)
{
Tab proc_tab(Tab::Process);
Tab export_tab(Tab::Export);
...
window.addTab(proc_tab.get() );
window.addTab(export_tab.get() );
}
Where Process and Export are unnamed public enums in Tab, defined in the class' body as:
Code:
public: enum {Process, Export}
The problem is the constructor declaration won't accept the enums as valid types. e.g this ends up in errors:
Code:
Tab(Process);
Tab(Export);
~Tab();
Is there a way to achieve what I want?
Thanks.