fork(1) download
  1. #include <iterator>
  2. #include <iostream>
  3. #include <sstream>
  4. using namespace std;
  5.  
  6. int main() {
  7. istringstream foo("13, lorem ipsum");
  8. const auto bar = *istream_iterator<int>(foo);
  9.  
  10. cout << bar << endl;
  11. }
Success #stdin #stdout 0s 4472KB
stdin
Standard input is empty
stdout
13