title: std::vector of std::function
body: <p>I have the following:</p>
  
  <pre><code>  typedef std::function&lt;void(const EventArgs&amp;)&gt; event_type;
  
    class Event : boost::noncopyable
    {
    private:
     typedef std::vector&lt;event_type&gt; EventVector;
     typedef EventVector::const_iterator EventVector_cit;
     EventVector m_Events;
  
    public:
     Event()
     {
     }; // eo ctor
  
     Event(Event&amp;&amp; _rhs) : m_Events(std::move(_rhs.m_Events))
     {
     }; // eo mtor
  
     // operators
     Event&amp; operator += (const event_type&amp; _ev)
     {
      assert(std::find(m_Events.begin(), m_Events.end(), _ev) == m_Events.end());
      m_Events.push_back(_ev);
      return *this;
     }; // eo +=
  
     Event&amp; operator -= (const event_type&amp; _ev)
     {
      EventVector_cit cit(std::find(m_Events.begin(), m_Events.end(), _ev));
      assert(cit != m_Events.end());
      m_Events.erase(cit);
      return *this;
     }; // eo -=
    }; // eo class Event
  </code></pre>
  
  <p>And during compilation:</p>
  
  <pre><code>1&gt;c:\program files (x86)\microsoft visual studio 10.0\vc\include\algorithm(41): error C2451: conditional expression of type 'void' is illegal
  1&gt;          Expressions of type void cannot be converted to other types
  </code></pre>
  
  <p>Now, I understand this is because of what is being stored in the vector and the operator <code>==</code>.  Is there another way to store <code>std::function</code> in an STL container?  Do I need to wrap it up in something else?</p>