
15 Jun
2011
15 Jun
'11
11:01 a.m.
On Wed, Jun 15, 2011 at 10:35:05AM +0000, Stephan T. Lavavej wrote:
[STL]
Actually, make_shared<T>() needs access to shared_ptr's guts, at least if the implementer takes advantage of the obvious and highly desirable optimization. They are tightly coupled to begin with.
[Emil Dotchevski]
However, the coupling between make_shared and shared_ptr is an implementation detail.
Right, that's what I was trying to say - internally, they are coupled, yet make_shared goes out of its way to be a free function.
Notable in general is that free functions can be forward declared on their own, but to declare and use a static member function, you need to have the class definition present. -- Lars Viklund | zao@acc.umu.se