|
Boost Users : |
Subject: Re: [Boost-users] [smart pointer] need .get() to access derived class method?
From: Dominique Devienne (ddevienne_at_[hidden])
Date: 2010-01-25 10:59:54
On Mon, Jan 25, 2010 at 8:47 AM, Diederick C. Niehorster
<dcnieho_at_[hidden]> wrote:
> That seems to have done the trick. Thank you for your lesson in
> pointers, casting and boost's version of it.
Glad to help. It's on this list I learned about them, not too long
ago. I'm now using them quite a bit in our code, and they were indeed
confusing for many developers in our team at first. Once you
understand they're just like the normal C++ casts, but for smart
pointers in general, it becomes obvious. It's an extensible mechanism
too, you can specialize the boot pointer cast templates for your own
smart pointers, although these days such home grown smart pointers
tend to be legacy (and buggy typically...)
Be sure to check out
http://www.boost.org/doc/libs/1_41_0/libs/smart_ptr/sp_techniques.html
for interesting things you can do with shared_ptr, if you want to dig
further. --DD
Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net