开发者

exact mechanics of istream::operator>> to string

开发者 https://www.devze.com 2023-02-22 08:50 出处:网络
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 lis

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

精彩评论

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