Is there a similar way to read integer pairs from stdin to vector<pair<int,int> > in C++ -


i wondering if there way slick following

copy(istream_iterator<int>(cin), istream_iterator<int>(),back_inserter(v)); 

to copy pairs of int vector<pair<int,int> > when input given in pairs in order of appearance?

thanks.

you can – need write own operator >> pair class first. operator whole secret of above call. actual implementation depends on format of int pairs.


Comments

Popular posts from this blog

java - SNMP4J General Variable Binding Error -

windows - Python Service Installation - "Could not find PythonClass entry" -

Determine if a XmlNode is empty or null in C#? -