开发者

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜