Template Trick

bearophile bearophileHUGS at lycos.com
Wed Jun 12 15:08:00 PDT 2013


matovitch:

> void func(V, V.type def_val) (uint i, V v)
> {
> 	if (i < v.dimension) {
> 		v.data[i] = def_val;
> 	}
> }

I think something like that is not yet possible, but maybe it 
will be possible later.

Your code has also allowed me to find a new small compiler bug 
that I have just filed:

http://d.puremagic.com/issues/show_bug.cgi?id=10346

Bye,
bearophile


More information about the Digitalmars-d-learn mailing list