Boost logo

Boost Users :

Subject: [Boost-users] [Preprocessor] Is it possible to expand recursively?
From: TONGARI (tongari95_at_[hidden])
Date: 2011-07-17 09:21:08


Hello,

I'd like to have a macro like:

BUILD_HIERARCHY
(a,
    (b,)
    (c,
        (d,)
        (e,)
    )
)

which should expand to:

struct a {};
struct b: a {};
struct c: a {};
struct d: c {};
struct e: c {};

Is this possible at all?
I have tried but with no luck, if this is impossible, please tell me so.

TIA



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