Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- /**
- * Print-eval
- *
- * Writes code as string to stdout, then executes it in current context
- */
- #define PE(code) std::cout << #code << std::endl; code
- int main()
- {
- PE(int x = 5;)
- PE(x += 3;)
- PE(for(int i = 0; i < 3; ++i)
- {
- x += 2;
- }
- )
- PE(return x;)
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement