Hello all, I have a question about the usage of parametric types. I know
these bring about a performance boost (at least that was my understanding),
but I have a situation where I have a parametric type defined as such:
type PricingEngine{T <: TermStructure}
varA::Float64
varB::Float64
ts::T
end
But then I need to actually swap the existing term structure with another
subtype of TermStructure further down the road. Using parametric types, it
complains because I guess it's locked in to using whatever TermStructure
sub type is initially there when I instantiate the PricingEngine type. Is
there anyway to do such an update while still using a type parameter, or am
I stuck just with a definition that uses the broader abstract type?
Thanks!
Chris