Uses of std::basic_string
c++
Solution
It was designed as a string class (hence, for example, `length()` and all those dozens of find functions), but after the introduction of the STL into the std lib it was outfitted to be an STL container, too (hence `size()` and the iterators, with `<algorithm>` making all the find functions redundant).
It's main purpose is to store characters, though. Using anything than PODs isn't guaranteed to work (and doesn't work, for example, when using Dinkumware's std lib). Also, the necessary `std::char_traits` isn't required to be available for anything else than `char` and `wchar_t` (although many implementations come with a reasonable implementation of the base template).
In the original standard, the class wasn't required to store its data in a contiguous piece of memory, but this has changed with C++03.
In short, it's mostly useful as a container of characters (a.k.a. "string"), where "character" has a fairly wide definition.
The "wildest" I have used it for is for storing differently encoded strings by using different character types. That way, strings of different encodings are incompatible even if they use the same character size (ASCII and UTF-8) and, e.g., assignment causes compile-time errors.
Problem
The `basic_string` class was apparently designed as a general purpose container, as I cannot find any text-specific function in its specification except for the `c_str()` function. Just out of curiosity, have you ever used the `std::basic_string` container class for anything else than storing human-readable character data? The reason I ask this is because one often has to choose between making something general or specific. The designers chose to make the `std::basic_string` class general, but I doubt it is ever used that way.