Reduce cost of including chaiscript.hpp
- ChaiScript no longer includes or automatically instantiates std lib - ChaiScript constructor now requires an std lib instance in the form of a ModulePtr object - This new layout facilitates better usage of compilation firewalls and factories for reducing the overall impact of ChaiScript on a project
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
#include <chaiscript/chaiscript_stdlib.hpp>
|
||||
#include <chaiscript/utility/utility.hpp>
|
||||
|
||||
class Test
|
||||
@@ -33,7 +34,7 @@ int main()
|
||||
|
||||
|
||||
|
||||
chaiscript::ChaiScript chai;
|
||||
chaiscript::ChaiScript chai(chaiscript::Std_Lib::library());;
|
||||
chai.add(m);
|
||||
if (chai.eval<std::string>("auto t = Test(); t.function2(); ") == "Function2"
|
||||
&& chai.eval<std::string>("auto t = Test(); t.functionOverload(1); ") == "int"
|
||||
|
Reference in New Issue
Block a user