Either you want
predict_consumption.(Ref(myCar), distances)
or define something like
Base.broadcastable(x::CarModel) = Ref(x)
to do this automatically for your type. See the manual on broadcasting.
Either you want
predict_consumption.(Ref(myCar), distances)
or define something like
Base.broadcastable(x::CarModel) = Ref(x)
to do this automatically for your type. See the manual on broadcasting.