I'm working with a legacy class that looks like this:
class A
{
enum Flags { One = 1, Two = 2 };
};
I'd like to pull out all the enums into a new namespace defined in a new header:
// flags.h
namespace flags {
enum Flags { One = 1, Two = 2 };
};
Then pull these enums back into the class so that I can include just the flags.h in headers that only require these values (rather than the entire class definition):
// a.h
#include "flags.h"
class A
{
using namespace flags;
};
How should I be doing this?