Proposal: takeFront and takeBack
deadalnix
deadalnix at gmail.com
Wed Jul 4 14:56:56 PDT 2012
Le 04/07/2012 22:34, Tobias Pankrath a écrit :
>
>> Yes. But the cost of copying the value and the cost of the exception are
>> separate.
> The argument is not about performance, it's about loosing values.
>
If you implement popFront as
{
popFront(); // current popFront
return front;
}
Then no value is lost with Exception. If an Exception is thrown, this is
dubious anyway, because the value is likely to be irrelevant anyway.
More information about the Digitalmars-d
mailing list