fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. #define SHOW() (cout<<__LINE__<<endl)
  5.  
  6. int main() {
  7. SHOW();
  8.  
  9. auto f = [ ]() { SHOW(); };
  10. auto g = [=]() { SHOW(); };
  11. auto h = [&]() { SHOW(); };
  12. struct I { void operator()() { SHOW(); } } i;
  13.  
  14. SHOW();
  15. f(); g(); h(); i();
  16. SHOW();
  17. f(); g(); h(); i();
  18. SHOW();
  19. }
  20.  
Success #stdin #stdout 0s 3296KB
stdin
Standard input is empty
stdout
7
14
9
10
11
12
16
9
10
11
12
18