Jarrett Billingsley Wrote:

> > I don't know if it would be pushing my luck or not, but is your concept 
> > generalizable to more parameters.  In particular I want to be able to 
> > extend this so than bar() can return a generic type.
> >
> 
> class Foo(T)
> {}
> 
> R bar(R, T : Foo!(U), U)(T t)
> {
>       R r;
>       return r;
> }
> 
> void main()
> {
>       auto foo = new Foo!(float)();
>       auto chu = bar!(double)(foo);
>       pragma(msg, typeof(chu).stringof);
> }
> 
> Make sure you have a newer compiler, though, as partial template
> specialization with IFTI was only introduced in DMD 1.038.

Thanks again.  I tried that before posting and it didn't work.  Checked my DMD 
version .. missed out by 0.001 .. I had DMD 1.037.

Upgraded just now to DMD 1.047 and your solution rocks yet again :-)

<JJ/>

Reply via email to