std::ostringstream woes
I can do
std::ostringstream os开发者_StackOverflows;
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
.
精彩评论