
On Mon, Jul 27, 2009 at 11:57 AM, Stewart, Robert<Robert.Stewart@sig.com> wrote:
Putting them in a class allows defining operators on the class type that aren't possible on an enumerated type (|=, ^=, etc.). Huh, and yet I've defined compound assignments for an enum type with gcc.
Actually, I thought it was only regular assignment that was restricted to classes.
The member functions can be expressed as namespace scope functions, and the static member that holds the maps, can be expressed as a namespace scope variable. However, a class offers privacy not available with a namespace. Thus, a class permits private member functions and data members to better control manipulations. Well, the namespace solution was used in a situation where I just wanted scoping, not string translation or anything else. But if both are needed, I certainly see your point.
--SPCD "Celtic Minstrel"