Re: [boost] Answers re BENUM library for automated enum streaming

From: David Abrahams <dave@boostpro.com>
[I/Tony wrote]:
BENUM(X, A = 1, B, C = 22, D = B|N);
This interface requires variadic (C99) preprocessor support, does it not?
Quite so David. So, limited portability - unless your preprocessor library has some relevant workarounds? Cheers, Tony

You could try to look at < http://www.boost.org/doc/libs/1_36_0/libs/preprocessor/doc/index.html> to avoid variadic macros. I am not sure if it is applicable at your library, though.

Oops, I didn't consider frames. The right URL is < http://www.boost.org/doc/libs/1_36_0/libs/preprocessor/doc/data/sequences.ht...

on Tue Sep 16 2008, Tony D <tony_in_da_uk-AT-yahoo.co.uk> wrote:
From: David Abrahams <dave@boostpro.com>
[I/Tony wrote]:
BENUM(X, A = 1, B, C = 22, D = B|N);
This interface requires variadic (C99) preprocessor support, does it not?
Quite so David. So, limited portability - unless your preprocessor library has some relevant workarounds?
I don't have a preprocessor library. For C98 compatibility Boost.Preprocessor would probably support BENUM(X, (A = 1)(B)(C = 22)(D = B|N)); -- Dave Abrahams BoostPro Computing http://www.boostpro.com
participants (3)
-
David Abrahams
-
Manuel Fiorelli
-
Tony D