
On Nov 15, 2012, at 11:31 AM, Matus Chochlik <chochlik@gmail.com> wrote:
Hi Marshall,
On Thu, Nov 15, 2012 at 8:19 PM, Marshall Clow <mclow.lists@gmail.com> 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.
Nice and thanks for your work! Personally I've been missing something like this in the standard many times and had to write some such class for several different projects.
You're welcome. I use it a bunch, too.
The header will be in boost/algorithm/string_ref.hpp, but I welcome discussion about where it should live. Ideally, I think it should be just "boost/string_ref.hpp".
+1 to boost/string_ref.hpp (it is not an algorithm)
I agree - but it is (will be useful) for string algorithms.
Basic sanity tests will be checked in with the header file - I have tested on clang, clang11, and gcc. One reason for checking this in now is to get the tests run on lots of different systems.
Docs will be coming soon, but http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2012/n3442.html is the proposal for "a future version of C++" ;-)
I hope it gets included into the standard soon.
"Soon" and "C++ standard" are generally not words you see together. We're hoping for 2014. -- Marshall Marshall Clow Idio Software <mailto:mclow.lists@gmail.com> A.D. 1517: Martin Luther nails his 95 Theses to the church door and is promptly moderated down to (-1, Flamebait). -- Yu Suzuki