Boost logo

Boost :

Subject: Re: [boost] enum / string translation
From: Celtic Minstrel (celtic.minstrel.ca_at_[hidden])
Date: 2009-07-27 12:07:14


On Mon, Jul 27, 2009 at 11:57 AM, Stewart, Robert<Robert.Stewart_at_[hidden]> 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"


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk