Thanks for the fast answer!
The drawback seems to be that the resulting type changes, if I understand it correctly depending on what concrete type I use in each thing
.
Is the following solution I found better?
(Taken from different topic )
struct thin{T}
p::Union{Float64,T}
someother_member
function thin{T}(p,someother_member) where {T}
T <: Function || throw(ArgumentError("invalid type"))
new{T}(p,someother_member)
end
end
I can call every type of p
via thing{Function}(p0,some0)
and it has the type
thing{function}
I just don’t know whether that is a performance advantage.