Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <functional>
- using namespace std;
- template<typename T> using predicate = function<bool(T)>;
- bool pred1(int){return false;}
- int main()
- {
- predicate<int> p = ([](int x){return x==3;});
- cout<<p(3)<<endl;
- cout<<p(2)<<endl;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement