Boost logo

Boost Users :

Subject: Re: [Boost-users] Enums to/from Strings
From: John M. Dlugosz (mpbecey7gu_at_[hidden])
Date: 2011-07-22 02:13:00


On 7/22/2011 12:19 AM, TONGARI wrote:

> There's Boost.Enums (not part of Boost yet) developed by Vicente, but I'm not sure the status.
>
> See:
> http://svn.boost.org/svn/boost/sandbox/enums/libs/enums/doc/html/index.html#boost.enums.users_guide.tutorial.str
>
>

He uses a function named c_str() in his own namespace, overloaded for each enumeration
type set up by the library. It doesn't do anything automatically with operator<<,
lexical_cast, or Boost.Format. You have to call c_str(e) when you want it.

For the time being, I've made a function called to_string, which seems to be a common
choice. But what's the best way to make it automatically known to those other features?


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net