Partially instantiating templates?

Magnus Lie Hetland magnus at hetland.org
Mon Jan 31 07:26:57 PST 2011


On 2011-01-31 15:50:41 +0100, Simen kjaeraas said:

> You might want to try more from dranges - the reftuple:
> 
> _(arg,val) = minArg(...);
[snip]
> This is also a possible implementation (coded in about 5 minutes, gives
> no nice error messages, but it seems to work :p ):

Thanks :)

> Yeah. D has the nice Eponymous Template Trick, but it sadly only works
> for one level. :(

Right :-/

> So you have to test for every single element of the range?

Yup.

> If so, I think this works:

Thanks. Hm. The nesting does seem similar to how I did it, but I guess 
there must be some crucial difference ;-)

At the moment, I'm using a mixing to create the min and max templates 
(as rather large strings). Probably not ideal.

Thanks!

-- 
Magnus Lie Hetland
http://hetland.org



More information about the Digitalmars-d-learn mailing list