Template Trick

matovitch camille.brugel at laposte.net
Wed Jun 12 14:56:46 PDT 2013


On Wednesday, 12 June 2013 at 21:52:46 UTC, Ali Çehreli wrote:
>
> Here is one way:
>
> void func(V, alias def_val) (uint i, V v)
>     if (is (typeof(def_val == V.type)))
> {
>     if (i < v.dimension) {
>         v.data[i] = def_val;
>     }
> }
>
> Ali

Thank you !


More information about the Digitalmars-d-learn mailing list