Oops, I lost this message due to its compact vertical size in my mail client :) Scrolled right past it.. sorry.
On Jun 11, 2015, at 09:33, Peter Dimov
wrote: Sam Kellett wrote:
I would prefer free-functions in a namespace. Something like:
better_enums::from_string<Channel>("Red");
I'm not a big fan of lexical_cast, but it should be noted that if Channel defines operator>>, the above could be spelled lexical_cast<Channel>("Red").
I’m planning to overload the stream operators, but probably in a separate header file. The reason is that including <iostream> slows down compilation by an order of magnitude or so compared to just the current contents of enum.h, when used for a few enums. Do you think I should just not bother with this, and include it anyway? Thanks, Anton