user3612009
user3612009

Reputation: 655

Is there a standard for C++ stream operators

Does the C++ standard specify how a stream in/out operators should behave? Specifically which characters to be taken as separators?

Upvotes: 2

Views: 110

Answers (2)

Dimitrios Bouzas
Dimitrios Bouzas

Reputation: 42889

Yes the standard specifies how I/O overloaded operators should behave in

  • 27.7.2.2 Formatted input functions [istream.formatted]
  • 27.7.3.6 Formatted output functions [ostream.formatted]

Upvotes: 1

rubenvb
rubenvb

Reputation: 76519

The reference page on std::istream::operator>> contains the numerical and stream overloads and how they work, and the non-member overload for std::basic_string defines the other variant.

Basically, std::isspace is used to end the input operation.

Any operator>> you define yourself behaves in the exact way that you define it of course...

Upvotes: 2

Related Questions