|
From: Kakhkhor A. <kab...@gm...> - 2010-12-24 23:39:36
|
Dear all, Current implementation of Handle class doesn't permit conversion from Handle<Derived> to Handle<Base>. If we supply Handle<Base> with converting constructor, an instance of Handle<Derived> could be substituted where an instance of Handle<Base> is expected. For example, an instance of Handle<SimpleQuote> could be passed to term structure constructors instead of Handle<Quote> instance. This conversion makes sense, since SimpleQuote is a subtype of Quote. Enabling conversion would allow user code use derived class features without a need for dynamic casting. Safety of conversion can be checked at runtime, similar to pointer down-casting. I did some coding in this direction and so far everything looks OK. Since it is a design decision and not a bug fix, I wanted to know what other think before submitting my code. Regards, Kakhkhor Abdijalilov. |