They are still polluting the global namespace, though. By the way... Remove the typedefRemove the typedef. You're working in C++. Those typedefs of enums and structs are polluting the code more than anything else.
enum RecordType { xNew = 1, xDeleted, xModified = 4, xExisting = 8 } RecordType;; void doSomething(RecordType p_eMyEnum) { if(p_eMyEnum == xNew) { // etc. } }
namespace RecordType { enum Value { xNew = 1, xDeleted, xModified = 4, xExisting = 8 } Value;; } void doSomething(RecordType::Value p_eMyEnum) { if(p_eMyEnum == RecordType::xNew) { // etc. } }