title: "Observer-Pattern" in C++ using Smart Pointer ?
body: <p>Professionals out there,</p>
  
  <p>this is the first time that I'm actually posting a question to this board that helped me out a lot in the past. I'm still a programming novice and have been trying to learn a lot about programming &amp; software development in the last few months. </p>
  
  <p>I recently tackled the topic "c++11-Smart Pointers" and decided rewrite all the Design Patterns I learned a few weeks earlier, including the"Observer Pattern" using shared_ptr &amp; weak_ptr for resource management.</p>
  
  <p>When I was trying to write a simple Implementation of the observer pattern (like in Head First's Design Pattern or Design Patterns by E.Gamma), using an interface-class for both the observable subjects and the observers, and exactly one concrete class for each, I received various error messages from Visual Studio.
  I just don't understand how to combine shared_ptr and weak_ptr in this pattern, which might be due to the fact that I still don't fully understand the the combination of both.</p>
  
  <p>Unfortunatelly, even a thorough search on the Internet didn't provide me with a simple example of an "observer-pattern using smart-pointer" that can serve as a orientation for me.</p>
  
  <p>I therefore was wondering, if one of you guys would know where to find such a simple implmentation or be so kind to provide me with one of your own. Both would be really really helpful :-)</p>
  
  <p>Thanks a lot</p>
  
  <p>coderAndi</p>