Boost logo

Boost :

From: the_dilster (dylan_at_[hidden])
Date: 2001-12-05 01:50:05


--- In boost_at_y..., "David Abrahams" <david.abrahams_at_r...> wrote:
> int f(char*);
> #define foo(expr) if (!(expr)) { f(#expr); }
> int main()
> {
> foo( f( "echo x \">\" foo.bar" ) );
> }
>
> yeilds:
>
> error C2146: syntax error : missing ')' before identifier 'foo'
>
> So, it's not just Metrowerks ;-)
>
It can't seem to handle stringizing a string literal with more than
one escaped double-quote - although \042 works fine (assuming ascii
character set).
One question though, does the standard actually expressly state that
the "stringized" version contains all the escape characters too? And
is there a way of stringizing something after the escape characters
have been processed? I'm guessing not because it would produce some
weird things:

Assertion failed: f("echo x ">" foo.bar"), file ...

as opposed to

Assertion failed: f("echo x \">\" foo.bar"), file ...


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