myClass.add(something)(otherthings)(thisToo);

Denis Koroskin 2korden at gmail.com
Wed Dec 10 09:09:03 PST 2008


On Wed, 10 Dec 2008 19:31:47 +0300, BCS <ao at pathlink.com> wrote:

> Reply to Denis,
>
>> On Wed, 10 Dec 2008 03:24:48 +0300, Jarrett Billingsley
>> <jarrett.billingsley at gmail.com> wrote:
>>
>>> On Tue, Dec 9, 2008 at 7:00 PM, BCS <ao at pathlink.com> wrote:
>>>
>>>> final void add(T...)(T t)
>>>>
>>> If all the params are the same type, typesafe variadics are a more
>>> efficient/less code-bloaty way to do it.
>>>
>> *And* allows overriding them!
>>
>
> Note the functionality that both solution provide is trivial. All the  
> real work gets done in the _add functions that /can/ be overridden.
>
>

In this case it can be made final (or avoided at all) to improve runtime  
performance.


More information about the Digitalmars-d-learn mailing list