Boost logo

Boost Users :

From: Darin Adler (darin_at_[hidden])
Date: 2001-12-18 13:14:14


On 12/17/01 7:00 PM, "Gustavo Guerra" <gustavobt_at_[hidden]> wrote:

> So, does anyone has any suggestions on how to implement my MAKE_FLAG_TYPE<N>
> macros using the Preprocessor library? Or is it just not possible?

The underlying issue is that you can't use a macro to define a macro. That
just how the C and C++ language macros work.

So

    #define X #define Y 1
    X

will not allow you to define Y by invoking X. You'll just get a syntax error
when the compiler sees the "#define" after expanding X.

I think the answer then is that it's just not possible, although there still
may be some creative way to use the PREPROCESSOR library to help with what
you are trying to do.

    -- Darin


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