Re:It Can Happen to You
by tedunangst on Wednesday March 03, 2021 @11:07PM
(#26338477)
Are there complexity guarantees for std::istream::operator>>?
[ Parent
| on HN ]
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
No, or at least not in general, because you can overload it for your custom types with whatever terrible implementation you like.