开发者

exact mechanics of istream::operator>> to string

I'm just not seeing this:

std::istringstream stream(somestring);

string temp;
stream >> temp;

In the last line, what is the exact fun开发者_JAVA技巧ction called? I can't find it in the list on cplusplus.com. Thanks!


If memory serves, it's a non-member function overload -- have a signature something like:

std::istream &operator>>(std::istream &is, std::string &s);

(For the moment I've left out the fact that both istream and string are really typedefs of template instantiations).


Do you mean istream& operator>> (istream& is, string& str);?

(on cplusplus.com)

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜