I wonder how much resistance the (re- ;-)) introduction of a 'real' lyx string class would meet.
Could be as simple as a struct wrapping a std::string<whatever> and delegating all of the work to std::string. The main advantages would be 'declarability' (i.e. class DocString; would suffice in lots of places where we have #include "docstring.h" (and consequently <string>) nowadays), and the possibility of having convenience functions (i.e. stuff from lstring, but also things like 'ends_with()' or such in the class. There should be no performance penalty as all the delegation would quite probably be inlined, i.e. the ninary might be even identical. The main problem I see is that some people will not be happy for political rather than technical reasons. Andre'