do you need a local copy here? why not "const std::set<std::string>& events"?