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
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With