Boost logo

Boost :

Subject: Re: [boost] Heads up - string_ref landing
From: Jeffrey Lee Hellrung, Jr. (jeffrey.hellrung_at_[hidden])
Date: 2012-11-16 00:30:24


On Thu, Nov 15, 2012 at 12:51 PM, Marshall Clow <mclow.lists_at_[hidden]>wrote:

> On Nov 15, 2012, at 12:41 PM, "Phil Endecott" <
> spam_from_boost_dev_at_[hidden]> wrote:
>
> > 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 mistyped:
> A string_ref is a non-owning reference to a contiguous sequence of
> characters.
>

How is this different from (say) contiguous_range< char > /
contiguous_range< char const > ? I can imagine a contiguous_range<T> that
wraps a pair of T*s, which would seem to be a simple generalization of your
proposed string_ref.

- Jeff


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk