News for hackers. Stuff that matters.
Re:It Can Happen to You by tedunangst on Wednesday March 03, 2021 @11:07PM (#26338477)
Are there complexity guarantees for std::istream::operator>>?
Re:It Can Happen to You by rtpg on Wednesday March 03, 2021 @11:20PM (#26338537)
In the standard there's things like "exactly N operations", but not seeing stuff for `istream`. There's like... an explanation of how things should work and I imagine you can derive complexity from it, but I think `istream` is a bit special since you're talking about this wrapper for (potentially) an arbitrary input source.

[0]: https://eel.is/c++draft/alg.move#15

[1]: https://eel.is/c++draft/input.streams#istream.extractors-7

Re:It Can Happen to You by mkl on Wednesday March 03, 2021 @11:21PM (#26338548)
No, or at least not in general, because you can overload it for your custom types with whatever terrible implementation you like.
Re:It Can Happen to You by loeg on Wednesday March 03, 2021 @11:47PM (#26338737)
This is true in essentially the same way for C's FILE, which is the point I think Ted is insinuating.