mirror of
https://github.com/ChaiScript/ChaiScript.git
synced 2025-12-06 16:57:04 +08:00
21 lines
380 B
C++
21 lines
380 B
C++
#include <chaiscript/chaiscript.hpp>
|
|
#include <chaiscript/chaiscript_stdlib.hpp>
|
|
|
|
double f(const std::string &, double, bool) noexcept {
|
|
return .0;
|
|
}
|
|
|
|
int main()
|
|
{
|
|
chaiscript::ChaiScript chai;
|
|
|
|
chai.add(chaiscript::fun(&f), "f");
|
|
|
|
const auto f = chai.eval<std::function<void ()>>(R"(fun(){ f("str", 1.2, false); })");
|
|
|
|
for (int i = 0; i < 100000; ++i) {
|
|
f();
|
|
}
|
|
|
|
}
|