Advertisement
konalisp

everything is a lambda no matter how much I have to shoehorn

Mar 5th, 2014
110
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.28 KB | None | 0 0
  1. #include <iostream>
  2. #include <functional>
  3.  
  4. using namespace std;
  5.  
  6. function<int(int)> trysumore = [](int a) {
  7.     return a*a;
  8. };
  9.  
  10. auto trysum = [](int a) -> int {
  11.     return a*a;
  12. };
  13.  
  14. int main(int argc, char **argv){
  15.     cout << trysum(3);
  16.     cout << "\n";
  17.     cout << trysumore(4);
  18. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement