Possible Duplicate:
Dynamic source code in C++
is there anything in c++ that executes strings? like in python, there are exec
, and to some extent eval
Actually no.
I don't know if this exceeds your needs,
http://boost-sandbox.sourceforge.net/libs/proto/doc/html/index.html
C# can do something like this, but i dont believe c++ can with standard libraries.
As C++ is a compiled language, there is no possibility to evaluate/execute runtime-generated code. Of course, you could send such code to a C++ compiler at runtime and start a new process using the built binary. But I think that would not address your purpose.
精彩评论