#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;)
}
Comments