Boost logo

Boost :

Subject: Re: [boost] [preprocessor] macro #definition order
From: Hartmut Kaiser (hartmut.kaiser_at_[hidden])
Date: 2010-09-21 15:23:23


> I have a curiosity about the preprocessor: In the following example, is
> there any difference if `CONCAT()` is #defined before or after
> `CONCAT_D()`?
>
> Example 1:
> #define CONCAT(a, b) CONCAT_D(a, b)
> #define CONCAT_D(a, b) a ## b
>
> Example 2:
> #define CONCAT_D(a, b) a ## b
> #define CONCAT(a, b) CONCAT_D(a, b)
>
> In other words, are example 1 and 2 completely equivalent? Or, is there is
> a functional difference (proper expansion order, portability, etc)? Or, is
> there a performance difference (number of macro expansions, preprocessing
> time, etc)?

There is no difference between the two examples - none whatsoever.

Regards Hartmun
---------------
http://boost-spirit.com

>
> I am asking because I would like to understand *in general* if the order
> in which I #define my macros when I program the preprocessor using
> Boost.Preprocessor might make a difference either functionally or for
> performance.
>
> Thank you very much.
>
> --
> Lorenzo
> _______________________________________________
> Unsubscribe & other changes:
> http://lists.boost.org/mailman/listinfo.cgi/boost


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