Advertisement
Guest User

Untitled

a guest
Oct 19th, 2018
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.27 KB | None | 0 0
  1. #include <iostream>
  2. #include <functional>
  3. using namespace std;
  4.  
  5. template<typename T> using predicate = function<bool(T)>;
  6.  
  7. bool pred1(int){return false;}
  8.  
  9. int main()
  10. {
  11.     predicate<int> p = ([](int x){return x==3;});
  12.  
  13.     cout<<p(3)<<endl;
  14.     cout<<p(2)<<endl;
  15. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement