On 06/12/2013 02:56 PM, matovitch wrote:
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)))
Oops. It should be:
if (is (typeof(def_val) == V.type))
Hmmm. How come the other one worked as well? Because the type of
(def_val == V.type) is compiled as bool and since bool is a valid type,
'is' passes.
{ if (i < v.dimension) { v.data[i] = def_val; } } AliThank you !
Ali
