Enabled short hand for adding new methods to existing C++ types

This commit is contained in:
Jason Turner
2009-09-20 21:32:39 +00:00
parent 593c6c68ee
commit 160f64e9c2
2 changed files with 28 additions and 17 deletions

View File

@@ -960,11 +960,17 @@ namespace chaiscript
}
else {
boost::optional<chaiscript::Type_Info> ti;
try {
ti = ss.get_type(class_name);
} catch (const std::range_error &) {
// No biggie, the type name is just not known
}
ss.add(Proxy_Function
(new Dynamic_Object_Function(class_name, Proxy_Function(new Dynamic_Proxy_Function(boost::bind(&eval_function<Eval_System>,
boost::ref(ss), node->children.back(),
param_names, _1), numparams,
annotation, guard)))), function_name);
annotation, guard)), ti)), function_name);
}
}