
Marshall Clow wrote:
I'm about to check in some new functionality into the string_algo library; an implementation of string_ref.
A string_ref is a non-owning reference to a string. It is implemented as a {pointer, length} pair, and is exceedingly useful when parsing, and manipulating strings in "read-only" ways.
I did something like this once. I called mine const_string_facade - I also had a mutable version - and it was a template that took an iterator pair. This lets you adapt something like a vector<char> into a string. BUT, I think my feeling is that this is actually taking us in the wrong direction: my current coding style tries to avoid the "special" features of std::string and prefers the things that are common to other containers, and std::algorithms. Regards, Phil.