libigl v2.5.0
Loading...
Searching...
No Matches
STR.h File Reference
#include <string>
#include <sstream>

Go to the source code of this file.

Macros

#define STR(X)   static_cast<std::ostringstream&>(std::ostringstream().flush() << X).str()
 Convert a stream of things to std:;string.
 

Macro Definition Documentation

◆ 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:

func("foo1bar");