Boost logo

Boost :

From: Paul Mensonides (pmenso57_at_[hidden])
Date: 2003-02-27 05:25:28


Russell Hind wrote:

>> #define A() 1
>> #define B(m) m 2
>>
>> B(A)
>>
>
> I've run the above through the preprocessor and heres the output
>
> /* Unit1.cpp 1: */
> /* Unit1.cpp 2: */
> /* Unit1.cpp 3: */
> /* Unit1.cpp 4: */A 2
>
> Tested using the preprocess option with BCB6Pro Update 4. This looks
> like what you were hoping for. If you'd like me to test anything else
> then just let me know.

Thanks Russell.

What happens if you compile it all the way, i.e. with a compileable example:

#include <iostream>

#define A() 1
#define B(m) m 2

#define STR(x) STR_D(x)
#define STR_D(x) #x

int main() {
    std::cout << STR(B(A)) << &std::endl;
    return 0;
}

When this program is executed, it should output "A 2", not "A2".

The reason that I ask is that the only thing I have is the free command line
tools. The included preprocessor, cpp32.exe, produces the correct output. The
compiler proper, bcc32.exe, does not. In other words, the behavior is/was
different with the separate preprocessor vs. the "integrated" preprocessor.

Regards,
Paul Mensonides


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