
Soares Chen Ruo Fei wrote:
Anyway I wonder if there is any use case of developer storing content as large as 1MB in a single std::string object, and I doubt any operation being done on that string would be efficient. Since Boost.Ustr is a string adapter it can make reasonable assumption the same way as general purpose string classes do, and I don't think any general purpose string class'd expect to scale to that large of size.
Err... No, I disagree. I should be able to have a string as large as my virtual memory will allow, and it should continue to perform according to its documented complexity guarantees however large it gets. For example, I have an IMAP mail server that uses std::string internally. This is not code that needs to be especially fast, but it does require that O(1) operations don't become O(N) operations, or that O(N) operations become O(N^2) operations. Phil.