Boost logo

Boost Users :

From: Marshall Clow (marshall_at_[hidden])
Date: 2007-09-28 17:10:42


At 11:37 PM +0300 9/28/07, Peter Dimov wrote:
>Diego Bernini:
>
> > Hi,
>> see these lines:
>>
>> boost::shared_ptr<Executor> executor(&(createExecutor(subclass,name)));
>> if(!executor) {
>> throw LoadingClassException("createExecutor function
>> of\""+subclass+"\" return null.");
>> }
>> //executor points to an object of class ExecDebugger that IS A Executor
>> //(it's a plugin loaded at run time via Qt)
>>
>> boost::shared_ptr<Nameable> a=executor;
>> boost::shared_ptr<Executor> sp;
>>
>> sp=boost::dynamic_pointer_cast<Executor>(a);
>
>It's possible that dynamic_cast doesn't work across dynamic libraries on
>your platform.

See
<http://lists.apple.com/archives/xcode-users/2006/Jul/msg00301.html>
(start there)
and
<http://lists.apple.com/archives/xcode-users/2006/Jul/msg00386.html>
and <http://developer.apple.com/technotes/tn2007/tn2185.html> for a
description of this problem (on Mac OS X, but really a gcc problem) -
especially the part around "Comparing types is important for catching
exceptions, dynamic_cast, and comparing type_info's obtained by a
typeid expression."

-- 
-- Marshall
Marshall Clow     Idio Software   <mailto:marshall_at_[hidden]>
It is by caffeine alone I set my mind in motion.
It is by the beans of Java that thoughts acquire speed,
the hands acquire shaking, the shaking becomes a warning.
It is by caffeine alone I set my mind in motion.

Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net