Search code examples
c++istream

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!


Solution

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