Boost logo

Boost :

Subject: Re: [boost] Heads up - string_ref landing
From: Marshall Clow (mclow.lists_at_[hidden])
Date: 2012-11-15 14:39:55

On Nov 15, 2012, at 11:31 AM, Matus Chochlik <chochlik_at_[hidden]> wrote:

> Hi Marshall,
> On Thu, Nov 15, 2012 at 8:19 PM, Marshall Clow <mclow.lists_at_[hidden]> 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
>> 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_at_[hidden]>

A.D. 1517: Martin Luther nails his 95 Theses to the church door and is promptly moderated down to (-1, Flamebait).
        -- Yu Suzuki

Boost list run by bdawes at, gregod at, cpdaniel at, john at