mardi 23 juin 2015

In c++11 what should happen first: raw string expansion or macros?

This code works in visual c++ 2013 but not in gcc/clang:

#if 0
R"foo(
#else
int dostuff () { return 23; }
// )foo";
#endif
dostuff();

Visual C++ removes the if 0 first. Clang expands the R raw string first (and never defining do). Who is right and why?

Aucun commentaire:

Enregistrer un commentaire