First of all, in my answer I will use Subject as the one who sends messages to registered observers, since this is a common use of these two terms.
Can I do a similar thing using instead std::unordered_set<weak_ptr<Observer>>?
. , , weak_ptr, , weak_ptr shared_ptr . , .
, std:: unordered_set > ?
, _ . , . , unique_set , , , .
, , , . , , , Java. , , shared_pointer .
- weak_ptr, , - , observer.lock(). get()?
-, -, /. / .
-, unique_set, , .
, , , , .