What is the correct way to pass only a type to control dispatch and use that type inside the function? As the title says, I want to do something like:
f(::T) where T = zero(T)
Is this one?
julia> f(T::DataType) = zero(T) f (generic function with 2 methods) julia> f(Float64) 0.0
edit: that does not work because the type of
T will be
DataType, thus the function will not specialize for