title: Provide same event handler to multiple instances
body: <p>I have a <code>Shape</code> class in my program that has some hit testing logic to figure out if the user clicked inside the shape or not.</p>
  
  <p><strong>Shape.h</strong></p>
  
  <pre><code>class Shape
  {
      Event&lt;ShapeArgs&gt; balloonBurst;
      virtual void onMousePress(); //called when hit test is true on user's click
      private:
      bool hitTest(int x, int y);
  };
  </code></pre>
  
  <p><strong>Shape.cpp</strong></p>
  
  <pre><code>virtual void onMousePress()
  {
      cout&lt;&lt;"Clicked inside the shape";
      ShapeArgs arg;
      arg.name = "XYZ";
      NotifyEvent(balloonBurst, arg);
  }
  </code></pre>
  
  <p>The main class has multiple instances of the above shape class
  <strong>Main program: (Main.h)</strong></p>
  
  <pre><code>vector&lt;Shape*&gt; shapes;
  void handleShape(ShapeArgs &amp;e);
  </code></pre>
  
  <p>.cpp</p>
  
  <pre><code>main()
  {
      for(int i=0;i&lt;10;++i){
          Shape *shape = new Shape(Color Color, string URL);
          shapes.push_back(shape);
      }
  }
  </code></pre>
  
  <p>Now, I have to listen to the <code>balloonBurst</code> event of the <code>Shape</code> instances above. If I would have a single instance, I would have done something like the following:</p>
  
  <pre><code>AddListener(shape-&gt;balloonBurst, this, &amp;MainProgram::handleBalloonBurst); //where shape is a single instance`
  </code></pre>
  
  <p>However, I have multiple  instances here and I am not sure how I should subscribe to them and provide the same handler method to the balloon (To be noted: Balloonburst event is not doing something that is not specific to that balloon, so unlike <code>C#</code> <code>sender</code> is not important to me in this event). <code>handleballoonBurst(ShapeArgs &amp;e)</code> will be doing a separate thing (not specific to the balloon from where the event came)</p>
  
  <p>How do I listen to the events of all the balloon shape instances here and provide a single handler method?</p>