Hello everyone,
I have a function that looks like this:
proc returnZero[T]() : T =
return T(0)
Run
and I would like to provide a default implementation that doesn't not require
to call the T type, defaulting it to float64.
The call would look like:
let val = returnZero() #returns a float64, instead of typing
returnZero[float64]()
Run
I have tried to implement a secondary proc to do so, but the compiler complains
about ambiguous calls:
proc returnZero() : float64 =
return float64(0)
Run
Is there a way to achieve this?