[comp.std.c++] preprocessing

kearns@softrue.UUCP (Steven Kearns) (01/22/91)

Given:
#define one(a, b)  a b

What does "one((c,d), {c,d})" expand to?
If {} are considered parentheses, then arm 16.3 would suggest
"(c,d) {c,d}", otherwise I might expect an error because
it is interpreted as one("(c,d)", "{c", "d}").


********************************************************
* Steven Kearns            ....uunet!softrue!kearns    *
* Software Truth           softrue!kearns@uunet.uu.net *
********************************************************

diamond@jit345.swstokyo.dec.com (Norman Diamond) (01/22/91)

In article <1.UUL1.3#8618@softrue.UUCP> kearns@softrue.UUCP (Steven Kearns) writes:

>#define one(a, b)  a b
>What does "one((c,d), {c,d})" expand to?
>If {} are considered parentheses, then arm 16.3 would suggest
>"(c,d) {c,d}", otherwise I might expect an error because
>it is interpreted as one("(c,d)", "{c", "d}").

The "otherwise" is correct; you should get an error.
--
Norman Diamond       diamond@tkov50.enet.dec.com
If this were the company's opinion, I wouldn't be allowed to post it.