rubenvb
rubenvb

Reputation: 76721

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 function called? I can't find it in the list on cplusplus.com. Thanks!

Upvotes: 1

Views: 422

Answers (2)

otto
otto

Reputation: 1158

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

(on cplusplus.com)

Upvotes: 2

Jerry Coffin
Jerry Coffin

Reputation: 490338

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).

Upvotes: 5

Related Questions