
I would like to propose adding const_pointer_cast<> to shared_ptr, in exactly the same way that there is dynamic_pointer_cast<> and static_pointer_cast<>. I am surprised that it is missing. Is there a reason for that? If not, I will submit a patch that implements this. Thanks. -- Colin

Colin Rafferty wrote:
I would like to propose adding const_pointer_cast<> to shared_ptr, in exactly the same way that there is dynamic_pointer_cast<> and static_pointer_cast<>.
I am surprised that it is missing. Is there a reason for that?
If not, I will submit a patch that implements this.
Thanks.
Isn't it already there? I see it on line 378 of shared_ptr.hpp in boost 1.31. Bob

"Robert Bell" <belvis@imageworks.com> wrote in message news:cermd6$hkb$1@sea.gmane.org...
Colin Rafferty wrote:
I would like to propose adding const_pointer_cast<> to shared_ptr, in exactly the same way that there is dynamic_pointer_cast<> and static_pointer_cast<>.
I am surprised that it is missing. Is there a reason for that?
If not, I will submit a patch that implements this.
Thanks.
Isn't it already there? I see it on line 378 of shared_ptr.hpp in boost 1.31.
Yes, here's the documentation: http://www.boost.org/libs/smart_ptr/shared_ptr.htm#const_pointer_cast Jonathan

Robert Bell <belvis@imageworks.com> wrote:
Colin Rafferty wrote:
I would like to propose adding const_pointer_cast<> to shared_ptr, in exactly the same way that there is dynamic_pointer_cast<> and static_pointer_cast<>.
Isn't it already there? I see it on line 378 of shared_ptr.hpp in boost 1.31.
I'm terribly sorry. I was looking at 1.30. -- Colin

Hmm, maybe you're looking at detail/shared_ptr_nmt.hpp? (which does not have these templates) My shared_ptr.hpp contains: template<class T, class U> shared_ptr<T> const_pointer_cast(shared_ptr<U> const & r) { return shared_ptr<T>(r, detail::const_cast_tag()); } -t On Aug 4, 2004, at 6:54 PM, Colin Rafferty wrote:
I would like to propose adding const_pointer_cast<> to shared_ptr, in exactly the same way that there is dynamic_pointer_cast<> and static_pointer_cast<>.
I am surprised that it is missing. Is there a reason for that?
If not, I will submit a patch that implements this.
Thanks.
-- Colin _______________________________________________ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
participants (5)
-
Colin Rafferty
-
colin.rafferty@morganstanley.com
-
Jonathan Turkanis
-
Robert Bell
-
troy d.straszheim