Why does remove_if( …, lambda ) expression require the assignment operator?
问题 I have this code (simplified) : std::vector<Session> sessions; // ... std::remove_if( sessions.begin(), sessions.end(), [] (const Session& s) { return false; } ); When I compile it (in Visual Studio 2013 Update 1) I get the following error: algorithm(1759): error C2280: 'Session &Session::operator =(const Session &)' : attempting to reference a deleted function Session.h(78) : see declaration of 'Session::operator =' Indeed, I have deleted operator= in the Session class like this: Session&