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,4 +1,5 @@
|
||||
#include <chaiscript/utility/utility.hpp>
|
||||
#include <chaiscript/chaiscript_stdlib.hpp>
|
||||
|
||||
double test_call(const std::function<double (int)> &f, int val)
|
||||
{
|
||||
@@ -8,7 +9,7 @@ double test_call(const std::function<double (int)> &f, int val)
|
||||
int main()
|
||||
{
|
||||
|
||||
chaiscript::ChaiScript chai;
|
||||
chaiscript::ChaiScript chai(chaiscript::Std_Lib::library());
|
||||
|
||||
chai.add(chaiscript::fun(&test_call), "test_call");
|
||||
|
||||
|
Reference in New Issue
Block a user