Boost logo

Boost :

Subject: Re: [boost] Is there interest in a library for string-convertible enums?
From: Felix Uhl (felix.uhl_at_[hidden])
Date: 2014-10-29 13:00:53

Artyom Tokmakov wrote:

>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.

And that’s where the problem lies. To enable large numbers of enum values,

I’d have to find a solution without using Boost.PP. Without C++ introducing

argument number based macro overloading, that is not possible, short of

defining my own macro sequences for more than 256 elements, which I would like to avoid.

I am still thankful that you asked for this, because it uncovered a huge implementation

problem which induces enormous compilation overhead (1 minute for 48 enum values on

my laptop).

I will do my best to make the library comprehend large enums, but I can’t guarantee

anything larger than 256.


Felix Uhl

Boost list run by bdawes at, gregod at, cpdaniel at, john at