Boost logo

Boost Users :

Subject: Re: [Boost-users] A library for "string chains"?
From: Jan Herrmann (jherrmann79_at_[hidden])
Date: 2014-08-18 02:46:21


On 15.08.2014 23:52, Richard wrote:
> [Please do not mail me a copy of your followup]
>
> Jan Herrmann <jherrmann79_at_[hidden]> spake the secret code
> <53EDB252.9060903_at_[hidden]> thusly:
>
>> On 14.08.2014 03:37, Richard wrote:
>>> Now the question remains... is there something that already exists
>>> that provides a string_view from a vector of string_ref's?
>>
>> Range with
>> http://www.boost.org/doc/libs/1_56_0/libs/range/doc/html/range/reference/utilities/join.html
>> could help.
>
> Hmm... looks interesting. Obviously that could be used to get a
> single iterator over two string_ref's.
>
> If I have a chain of string_ref's r1...rN, it looks like I'd have to do:
>
> join(r1, join(r2, join(r3, join(r4, ..., join(rN-1, rN) ...)))
>
> Which doesn't look promising, but I'll give it a go.
>

I think you will loose an O(1) indexed access but that might not be a
problem. To join a container of string_refs std::accumulate could help.

Jan Herrmann


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net