Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <cstdio>
- #include <functional>
- #if defined(STDFUNC)
- void foo(const std::function<int()>& fn);
- #define XXX foo([&]() -> int { return __COUNTER__ + x; });
- #else
- void foo(void*, int(*fn)(void*));
- #define XXX \
- { \
- auto fn = [&]() mutable -> int { \
- return __COUNTER__ + x; \
- }; \
- foo((void*)&fn, [](void* ud)->int{ \
- auto f = (decltype(fn)*)ud; \
- return (*f)(); \
- }); \
- }
- #endif
- #define YYY XXX;XXX;XXX;XXX;XXX;
- #define ZZZ YYY;YYY;YYY;YYY;YYY;
- void bar(int x){
- ZZZ;
- ZZZ;
- ZZZ;
- ZZZ;
- ZZZ;
- ZZZ;
- ZZZ;
- ZZZ;
- ZZZ;
- ZZZ;
- ZZZ;
- ZZZ;
- ZZZ;
- ZZZ;
- ZZZ;
- ZZZ;
- ZZZ;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement