|
Boost : |
From: Rob Stewart (stewart_at_[hidden])
Date: 2003-01-14 13:47:31
From: "Peter Dimov" <pdimov_at_[hidden]>
> From: "David Abrahams" <dave_at_[hidden]>
> > "Peter Dimov" <pdimov_at_[hidden]> writes:
> >
> > > if(shared_ptr<X> px = make_shared(wp))
> > > {
> > > // ...
> > > }
> > >
> > > You still need to spell "shared_ptr<X>" in its entirety.
> >
> > I don't think so:
> >
> > some_function(make_shared(wp));
>
> Of course you could do that as well, but my point is that the primary
> purpose of make_* functions is argument deduction, and the primary purpose
> of make_shared/get_shared_ptr is to support the idiom above, where argument
> deduction isn't important.
I'm confused. Consider std::make_pair():
std::pair<int, int> pr = std::make_pair(1, 3);
some_function(std::make_pair(1, 3));
How is boost::make_shared() different?
-- Rob Stewart stewart_at_[hidden] Software Engineer http://www.sig.com Susquehanna International Group, LLP using std::disclaimer;
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk