Advertisement
Vultraz

Untitled

Oct 5th, 2017
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.67 KB | None | 0 0
  1. //
  2. // FROM
  3. //
  4.  
  5. struct modevents_entry_for
  6. {
  7.     // This typedef is used by boost.
  8.     typedef modevents_entry result_type;
  9.  
  10.     modevents_entry_for(const std::string& type)
  11.         : type_(type)
  12.     {
  13.     }
  14.  
  15.     modevents_entry operator()(const std::string& id) const
  16.     {
  17.         return modevents_entry(type_, id);
  18.     }
  19.  
  20. private:
  21.     std::string type_;
  22. };
  23.  
  24. boost::copy(mp_settings_.active_mods | boost::adaptors::transformed(modevents_entry_for("modification")),
  25.     std::back_inserter(mods));
  26.  
  27. //
  28. // TO
  29. //
  30.  
  31. std::transform(mp_settings_.active_mods.begin(), mp_settings_.active_mods.end(), std::back_inserter(mods),
  32.     [](const std::string& id) { return modevents_entry("modification", id); }
  33. );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement