See More

#include int main() { // We cannot deduce the type of a lambda expression, you must either wrap it // in an std::function or provide the signature chaiscript::ChaiScript chai; // provide the signature chai.add(chaiscript::fun<:string>([] { return "hello"; } ), "f1"); // wrap chai.add(chaiscript::fun(std::function<:string>([] { return "world"; } )), "f2"); if (chai.eval<:string>("f1()") == "hello" && chai.eval<:string>("f2()") == "world") { return EXIT_SUCCESS; } else { return EXIT_FAILURE; } }