This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ project.
| Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
|---|---|---|
| Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |
| Other format: | [Raw text] | |
#define SFORMAT(e) ((dynamic_cast<const ostringstream&> (ostringstream() << e)).str())
int main(int argc, char* argv[]) { cout << SFORMAT("2 x " << " 2 = " << 2*2); return 0; }
When I compile and run it, the first string constant ("2 x ") is printed as pointer in hexadecimal form. The second constant (" 2 = ") prints as it should. ltrace shows that first one is printed by
| Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
|---|---|---|
| Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |