I can do
std::ostringstream oss;
oss << 1;
oss.str();
so why can't I do:
((std::ostringstream()) << 1).str() ?
Thanks!
I can do
std::ostringstream oss;
oss << 1;
oss.str();
so why can't I do:
((std::ostringstream()) << 1).str() ?
Thanks!
The << operator returns the base type ostream, while the str member function exists only on the derived type ostringstream.