Advertisement
GeneralGDA

Lambda inheritance in VS2013 update 4.

Nov 11th, 2015
453
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.36 KB | None | 0 0
  1. int _tmain(int, _TCHAR*)
  2. {
  3.     int p = 10;
  4.  
  5.     auto fun = [p]() { std::cout << p << std::endl; };
  6.  
  7.     using Bar = decltype(fun);
  8.  
  9.     class Goo : public Bar
  10.     {
  11.     public:
  12.  
  13.         Goo(Bar zig)
  14.             : Bar(zig)
  15.         {
  16.            
  17.         }
  18.  
  19.         void operator()()
  20.         {
  21.             std::cout << "1 fejfiekgeo" << std::endl;
  22.             Bar::operator()();
  23.         }
  24.  
  25.     };
  26.  
  27.     Goo goo(fun);
  28.  
  29.     goo();
  30.  
  31.     return 0;
  32. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement