August 12, 2004 [Bug report] Whitespace prevents concatenation in preprocessor | ||||
---|---|---|---|---|
| ||||
Hi, I've come across a few bugs in the preprocessor while converting the boost preprocessor library. This one is probably the most problematic. In the preprocessor, if a macro argument contains whitespace then it prevents concatenation. The following example illustrates this: #define EMPTY #define CAT(x, y) CAT2(x, y) #define CAT2(x, y) x##y CAT(2 EMPTY, 2) // On DMC = 2 2 CAT(2, EMPTY 2) // On DMC = 2 2 Both concatenations should expand to '22', but instead result in '2 2'. Daniel |
Copyright © 1999-2021 by the D Language Foundation