
7 Aug
2004
7 Aug
'04
1:14 a.m.
troy d.straszheim wrote:
[...] Somehow it has got stuck in my head that this should be shared_pointer_cast<>, but I'm having trouble justifying it, other than that it would look nice next to the dynamic_pointer_cast<> and so forth.
shared_ptr<Widget> p = shared_ptr_cast<Widget>(new Widget); [...]
I kinda like the idea as well. In a sense, you *are* converting the type of the pointer returned by new from a raw pointer to a shared_ptr<>. However, I wonder how much benefit would be derived from this change in practice. This would break all existing shared_ptr<> code, wouldn't it? Dave