cplusplus
.com
TUTORIALS
REFERENCE
ARTICLES
FORUM
C++
Tutorials
Reference
Articles
Forum
Forum
Beginners
Windows Programming
UNIX/Linux Programming
General C++ Programming
Lounge
Jobs
Forum
Beginners
executing a string
executing a string
Jul 25, 2013 at 6:29pm UTC
metulburr
(585)
Is their a method for meta programming in c++? If there is not a direct method to allow the execution of a string, is there a way around it?
sort of:
1
2
std::string s =
"std::cout << \"test\";"
; eval(s);
where it would execute the string as code?
Last edited on
Jul 25, 2013 at 6:32pm UTC
Jul 25, 2013 at 7:00pm UTC
vlad from moscow
(6539)
Meta programming in C+ is being done with templates or constexpr functions. There is no such a possibility as eval( std::string( "Some code" ) ) in C++.
Last edited on
Jul 25, 2013 at 7:01pm UTC
Topic archived. No new replies allowed.