Guest User

Untitled

a guest
Jun 25th, 2018
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.86 KB | None | 0 0
  1. void DoSomething(const boost::function<bool ()>& condition, other stuff);
  2.  
  3. boost::function<bool (size_t)> ge = boost::bind(std::greater_equal<size_t>(),
  4. _1, threshold);
  5. boost::function<size_t ()> size = boost::bind(&std::vector<std::string>::size,
  6. data);
  7. DoSomething(boost::lambda::bind(ge, boost::lambda::bind(size)), other stuff);
  8.  
  9. DoSomething(delegate() { return data.size() >= threshold; }, other stuff);
  10. DoSomething(() => (data.size() >= threshold), other stuff);
  11.  
  12. boost::function<size_t ()> size = boost::bind(&std::vector<std::string>::size,
  13. boost::ref(data));
  14.  
  15. boost::function<bool ()> cond =
  16. (boost::bind(&std::vector<std::string>::size, boost::ref(data))
  17. >= threshold);
  18.  
  19. DoSomething(cond, other stuff);
Add Comment
Please, Sign In to add comment