title: Observer Pattern Via Boost Signal2
body: <p>So, I've read the docs for Boost.Signal2 and I have done a bit of googling and I just haven't quite found what I needed. What I have is a controller and a view concept. The Controller will be sending data to the View for it to render. What I want is my controller to call Controller::Update and trigger the OnUpdate function in the view. </p>
  
  <ul>
  <li>The controller and view should be disjoint</li>
  <li>Signals on the <strong>Controller</strong> can be emitted to execute Slots in the <strong>View</strong></li>
  </ul>
  
  <p>Here is code I have tried so far:</p>
  
  <pre><code>class Listener {
  public:
      virtual void OnUpdate() {};
  };
  
  class View :Listener
  {
  public:
      View(void);
      ~View(void);
      virtual void OnUpdate() override;
  };
  
  void View::OnUpdate()
  {
      std::cout &lt;&lt; "Updating in View";
  }
  
  class Controller
  {
  public:
      Controller(void);
      ~Controller(void);
      void Update();
  };
  
  Controller::Controller(void)
  {
      // Signal with no arguments and a void return value
      boost::signals2::signal&lt;void ()&gt; sig;
      sig.connect(boost::bind(&amp;Listener::OnUpdate, this, _1));
      // Call all of the slots
      sig();
      system("pause");
  }
  </code></pre>
  
  <p>This does not compile. I get <strong>error C2825: 'F': must be a class or namespace when followed by '::'</strong>, but this is just because I'm using bind incorrectly.</p>
  
  <p>Does anybody know how I could achieve what I want using signals/slots from boost?</p>