50 ms·
Are there complexity guarantees for std::istream::operator>>?
by tedunangst 6y ago
Are there complexity guarantees for std::istream::operator>>?
- rtpg 6y agoIn 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 https://eel.is/c++draft/alg.move#15 [1]: https://eel.is/c++draft/input.streams#istream.extractors-7 https://eel.is/c++draft/input.streams#istream.extractors-7
- mkl 6y agoNo, or at least not in general, because you can overload it for your custom types with whatever terrible implementation you like.
- loeg 6y agoThis is true in essentially the same way for C's FILE, which is the point I think Ted is insinuating.