Login  Register

Re: [Quantlib-dev] Pointer Casting

Posted by Kakhkhor Abdijalilov on Sep 01, 2010; 11:39am
URL: http://quantlib.414.s1.nabble.com/Himalayan-Option-Worries-tp6914p6921.html

static_pointer_cast on smart pointer will perform static_cast on the
contained pointer. static_cast will never fail at compiler time
(unless you try to cast away qualifiers such as const or volatile).
But if the conversion is illegal, the code will fail at runtime.
dynamic_cast will check at compile time if the pointer is being
downcast. If target is not inherited from the source, dynamic_cast
will refuse to compile.

static_cast cast is faster then dynamic_cast, but inherently unsafe.
In the above example it is used not in performance critical place.

Hope it help.

------------------------------------------------------------------------------
This SF.net Dev2Dev email is sponsored by:

Show off your parallel programming skills.
Enter the Intel(R) Threading Challenge 2010.
http://p.sf.net/sfu/intel-thread-sfd
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users