$include_dir="/home/hyper-archives/boost-users/include"; include("$include_dir/msg-header.inc") ?>
From: Yossi.Itzkovich_at_[hidden]
Date: 2006-07-26 03:03:04
Hi,
I have this code:
#include <boost/shared_ptr.hpp>
class A{ // base class
public:
};
class B : public A{
public:
int b1;
};
typedef boost::shared_ptr<A> tSmartA;
typedef boost::shared_ptr<B> tSmartB;
void foo (tSmartB& smartOne) // should get a pointer to derived
{ }
int main () {
tSmartA a(new B);
foo(a); // This line doesn't compile because foo expects to get tSmartB
return 0;
}
How can I then send a to foo() ?
Thanks
Yossi