Advertisement
Guest User

Untitled

a guest
Jan 18th, 2018
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.43 KB | None | 0 0
  1. #include <set>
  2. #include <vector>
  3.  
  4. class A
  5. {
  6. private:
  7.     std::vector<std::set<unsigned, bool(*)(unsigned,unsigned)>> neighbours;
  8. public:
  9.     void run();
  10. };
  11.  
  12. void A::run()
  13. {
  14.     for (int i = 0; i < 10; ++i)
  15.         neighbours.emplace_back([i](unsigned a, unsigned b){
  16.         // neighbours.emplace_back([](unsigned a, unsigned b){ - with this line instead it compiles
  17.             return a < b;
  18.         });
  19. }
  20.  
  21. int main()
  22. {
  23.     A a;
  24.     a.run();
  25.  
  26.     return 0;
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement