I have a struct which should contain a parametrized function returning a certain type.
Can I impose this type restriction onto the struct field?
using Unitful
struct a
T::Function # This will allow any function
end
obj = a((t)->3u"K/s"*t)
energy = obj.T(1u"s")
5 posts - 3 participants