Boost logo

Boost Users :

From: Dragan Milenkovic (tyrant_at_[hidden])
Date: 2003-10-07 14:05:15


Hello, people,

I've been using enable_shared_from_this a LOT, mostly for implementing
the Observer pattern (an object holds a list of weak pointers to it's
observers).

I wanted to know why are shared_from_this member functions public
instead of being protected?

Also, I've used the following expression a few times:

shared_polymorphic_cast<This>(shared_from_this())

Any thoughts on putting it inside the enable_shared_from_this...
shared_from_base<This>() or polymorphic_shared_from_this<This>() or
such?

Also, any comments on the designs I used? Better observers?

Best regards,
Dragan Milenkovic


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