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

BCS ao at pathlink.com
Tue Dec 9 16:00:27 PST 2008


Reply to TSalm,

> Hello,
> 
> How to implement an object that can do this :
> myClass.add(something)(otherthings)(thisToo);
> Is it possible ?
> 
> TIA,
> TSalm

if you don't mind dropping the )(


class C
{
    final void add(T...)(T t)
    {
        foreach(int i,_;T)
            _add(t[i]);
    }
    //.....
}


(new C).add(something, otherthings, thisToo);




More information about the Digitalmars-d-learn mailing list