Boost logo

Boost :

Subject: Re: [boost] Heads up - string_ref landing
From: Olaf van der Spek (ml_at_[hidden])
Date: 2012-11-15 14:39:31


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.

Great!

> 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.

Wouldn't a ptr pair be better?

> 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".

I'd go with the latter.
I'm missing explicit operator bool() const { return !empty(); }

Olaf


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