$include_dir="/home/hyper-archives/boost-users/include"; include("$include_dir/msg-header.inc") ?>
From: Peter Dimov (pdimov_at_[hidden])
Date: 2006-07-12 10:22:09
eric wrote:
> hello
> 
> given the following class hierarchy
> 
>    class Foo {
>    protected:
>        virtual ~Foo() {}
>    };
> 
>    class Bar : public Foo {};
> 
> and declaration
> 
>    boost::shared_ptr<Foo> foo;
> 
> is there any difference between the two assignment statements below?
> 
>    foo = boost::shared_ptr<Foo>(new Bar);
>    foo = boost::shared_ptr<Bar>(new Bar);
No, the first form is a shorthand for the second form, and so is
    foo.reset( new Bar );