
We're using smart pointers, and due to the way that they are created, we
wish to hide the functionality behind a static create() function for
each class. That way, the callers only need call create() and they have
a smart_pointer to a new object, without having to worry too much about
implementation details.
So, this has been working fine, until I tried doing some polymorphism.
Basically, we have a smart pointer to a base class, where the derived
class is chosen at run time, (based on what the caller wants to do).
The base class is pure virtual, so we don't know, (or care to know) how
the child class implements its functionality. The following code
illustrates what I'm trying to do:
#include <iostream>
#include

I knew it was something stupid... Thanks --dw
-----Original Message----- From: boost-users-bounces@lists.boost.org [mailto:boost-users-bounces@lists.boost.org] On Behalf Of Steven Watanabe Sent: Tuesday, November 18, 2008 10:38 AM To: boost-users@lists.boost.org Subject: Re: [Boost-users] Up-casting shared_ptr
AMDG
david.weber@l-3com.com wrote:
Derived class class d1 : base
Try public inheritance.
In Christ, Steven Watanabe
_______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users
participants (2)
-
david.weber@l-3com.com
-
Steven Watanabe