Boost logo

Boost :

Subject: Re: [boost] Is there interest in a library for string-convertible enums?
From: Artyom Tokmakov (artyom.tokmakov_at_[hidden])
Date: 2014-10-29 03:26:04


> What features would you want from such a library?

Hello, thanks for the proposal, it's very useful!

In addition to various useful suggestions on the list, I would ask for
implementation to support (almost) any large number of enum elements
(enumerators) within enum declaration.:
I have ad-hoc implementation of my own which uses Boost.Proprocessor's
sequence to define enum elements. Then I can generate whatever
parser/printer/other code I want (I find that very useful).

There's a disadvantage, however: obvious limitation of max 256
elements (at least, by default) coming from Boost.Preprocessor.
In fact, I hit some other limitations even before that. One of them
was max 'if else' statements (I used them in parser implementation.
Don't judge me, it was good enough!). When I fixed that, my VC
compiler started complaining about some macro processor limitations
around 220 enum elements (don't have details handy).

Speed of parsing/printing implementation doesn't matter for me.

PS: This is my first post in this DL, sorry if I broke some rules.

-- 
Best regards,
Artem Tokmakov

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