Boost logo

Boost :

Subject: Re: [boost] [Potentially OT] String Concatenation Operator
From: Jeremy Maitin-Shepard (jeremy_at_[hidden])
Date: 2010-08-26 10:37:06


On 08/26/2010 07:07 AM, Mathias Gaunard wrote:

> [snip]

> There is no "inherently supported" or "not inherently supported".
> Linearizing the memory means you have to copy it in a contiguous buffer.

I'm not sure which protocol you're thinking of, but even over a UDP
socket you can use scatter/gather send/recv (at least under POSIX). It
is not clear that this mechanism is necessarily substantially more
efficient in practice than just copying the data to a contiguous buffer,
but in principle it seems useful for the data structure, assuming it is
in fact represented as a sequence of arrays, to provide a way to access
that underlying representation for the purpose of IO. Although I
imagine this facility would be used most often with char arrays, I agree
there is no advantage (except perhaps faster compilation due to reduced
use of templates) in restricting it to char.

> [snip]

> Then why the string_handle thing? You want a type that represents the
> expression.

It seems that the idea would be better realized by replacing
string_handle with auto. Still, I would think the same result could be
achieved by implementing certain optimizations in the existing join,
e.g. joining statically sized arrays produces a single statically sized
array.

> [snip]


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