pros cons controlling nested c++ classes enumerations?


what pros cons controlling nested open c++ classes enumerations? example, suspect have category called printer, category also stores information cost trays, have:



class printer
{
public:
std::string name_;

enum type
{
type_local,
type_network,
};

category output_tray
{
...
};
...
};

printer prn;
printer::type type;
printer::output_tray tray;


alternatively:



class printer
{
public:
std::string name_;
...
};

enum printer_type
{
printer_type_local,
printer_type_network,
};

class output_tray
{
...
};

printer prn;
printer_type type;
output_tray tray;


i advantages nesting private enums/classes, nonetheless comes open ones, business separate - seems some-more impression choice.



so, move why?



Comments

Popular posts from this blog

list macos calm editors formula editors

how hibernate @any-related annotations?

why does floated <input> control floated component slip over too distant right ie7, nonetheless firefox?