Former-commit-id: 75006a1b4f1b57389512d91a386019e05e07640c
@@ -0,0 +1,11 @@
+#ifndef C_STR_H
+#define C_STR_H
+// http://stackoverflow.com/a/2433143/148668
+// Suppose you have a function:
+// void func(const char * c);
+// Then you can write:
+// func(C_STR("foo"<<1<<"bar"));
+#include <string>
+#include <sstream>
+#define C_STR(X) static_cast<std::ostringstream&>(std::ostringstream().seekp(0) << X).str().c_str()
+#endif
+#ifndef STR_H
+#define STR_H
+// void func(std::string c);
+// func(STR("foo"<<1<<"bar"));
+#define STR(X) static_cast<std::ostringstream&>(std::ostringstream().seekp(0) << X).str()