$include_dir="/home/hyper-archives/boost-users/include"; include("$include_dir/msg-header.inc") ?>
From: Lex Fridman (lexfridman_at_[hidden])
Date: 2008-04-24 17:34:35
Hi,
Say I have a class definition:
class Foo() {...};
And an instance of that class:
Foo fooInstance;
I would like to create a shared_ptr pointing to this instance of Foo.
Most documentation recommends the following way to do it:
shared_ptr<Foo> bla(new Foo(fooInstance));
But can I also do this:
shared_ptr<Foo> bla;
bla = shared_ptr<Foo>(new Foo(fooInstance));
Are there any problems with the second (or the first) method?
Thanks,
Lex