tango list

Steven Schveighoffer schveiguy at yahoo.com
Thu Feb 28 06:43:20 PST 2008


"Christopher Wright" wrote
> quest wrote:
>> hi,
>>
>> i would like to hand over some LinkSeq list to some funktions. what would 
>> be function header??
>>
>>
>> void testfunc(???? lists, int bolony) { ....  }
>>
>> seems like i can't use LinkSeq for the ????.
>
> // Use a list of any type of element
> void testfunc(T)(ListSeq!(T) list, int bologna) {}
>
> Unfortunately, you won't be able to put that in an interface.

you can, but not in the way you are saying:

interface myinterface(T)
{
   void testfunc(ListSeq!(T) list, int balogna);
}

In fact, all the tango containers implement interfaces like this.

-Steve 




More information about the Digitalmars-d-learn mailing list