Vultraz

Untitled

Aug 1st, 2016
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.49 KB | None | 0 0
  1. template<typename T> void tunit_recall::init_sorting_option(std::vector<tgenerator_::torder_func>& order_funcs, T filter_on)
  2. {
  3.     order_funcs[0] = [this, filter_on](unsigned i1, unsigned i2)->bool {
  4.         return filter_on((*recall_list_)[i1]) < filter_on((*recall_list_)[i2]);
  5.     };
  6.  
  7.     order_funcs[1] = [this, filter_on](unsigned i1, unsigned i2)->bool {
  8.         return filter_on((*recall_list_)[i1]) > filter_on((*recall_list_)[i2]);
  9.     };
  10. }
  11.  
  12. init_sorting_option(order_funcs, std::bind(&unit::type_name, _1));
Advertisement
Add Comment
Please, Sign In to add comment