$include_dir="/home/hyper-archives/boost/include"; include("$include_dir/msg-header.inc") ?>
From: David Abrahams (abrahams_at_[hidden])
Date: 2000-08-09 07:05:38
----- Original Message -----
From: "John Maddock" <John_Maddock_at_[hidden]>
> By using something like this internally in shared_ptr, the range of
> available convertions for polymorphic types would be greatly extended,
> without changing existing behaviour as far as I know. The down side is an
> increase in complexity of the curently simple shared_ptr template.
>
> Thoughts?
Wouldn't this also allow code which implicitly converts unrelated types of
shared_ptrs to compile? I would really *hate* that:
struct X { virtual ~X(); };
struct Y { virtual ~Y(); };
void transmogrify(boost::shared_ptr<Y>);
boost::shared_ptr<X> xp( new X );
transmogrify(xp);// <== used to be an error. That was a GOOD thing.
Also, wouldn't it allow code which implicitly converts base to derived to
compile? I would really *hate* that, too.
-Dave