Proposal: takeFront and takeBack

Dmitry Olshansky dmitry.olsh at gmail.com
Wed Jul 4 01:35:27 PDT 2012


On 04-Jul-12 12:29, Mehrdad wrote:
> On Wednesday, 4 July 2012 at 08:25:59 UTC, Roman D. Boiko wrote:
>> That would be almost perfect. But has drawbacks:
>>
>> * if element is big and may be not needed in all calls to popFront
>> (when the user wants to ignore elements), there would be some overhead;
>
> Could you give an example of such a range? Does such a heavyweight range
> come up in practice? (I'm assuming RVO would take care of not calling
> copy constructors and such.)
>

UTF strings - calculating length of codepoint is cheaper then actually 
decoding it and then throwing away.

-- 
Dmitry Olshansky




More information about the Digitalmars-d mailing list