#include <string>
#include <sstream>
Go to the source code of this file.
|
#define | STR(X) static_cast<std::ostringstream&>(std::ostringstream().flush() << X).str() |
| Convert a stream of things to std:;string.
|
|
◆ STR
#define STR |
( |
|
X | ) |
static_cast<std::ostringstream&>(std::ostringstream().flush() << X).str() |
Convert a stream of things to std:;string.
Suppose you have a function:
void func(std::string s);
Then you can write:
func(
C_STR(
"foo"<<1<<
"bar"));
#define C_STR(X)
Convert a stream of things to a const char *.
Definition C_STR.h:28
which is equivalent to: