Proposal: takeFront and takeBack

Mehrdad wfunction at hotmail.com
Wed Jul 4 01:18:34 PDT 2012


On Wednesday, 4 July 2012 at 08:16:32 UTC, Roman D. Boiko wrote:
> On Wednesday, 4 July 2012 at 08:13:10 UTC, Mehrdad wrote:
>> What's wrong with moveFront()?
>
> It has different semantics. For example, it is only supported 
> for ranges which have movable elements. After moveFront, the 
> element which was placed in the front position is replaced by 
> E.init (E is element type).

WHOA I did not know that.

I just thought it was front() + popFront()...

In that case I think we _really_ need to get the naming right 
(consume is horrible, IMO -- very unintuitive) to avoid 
confusion....


More information about the Digitalmars-d mailing list