Add const correctness for proxy functions. Add unit tests for function variable assignment scenarios

This commit is contained in:
Jason Turner
2009-09-19 21:13:12 +00:00
parent c5f837fd19
commit 7cdd772f2b
12 changed files with 63 additions and 32 deletions

View File

@@ -87,7 +87,7 @@ namespace chaiscript
virtual ~Dispatch_Function() {}
virtual Boxed_Value operator()(const std::vector<Boxed_Value> &params)
virtual Boxed_Value operator()(const std::vector<Boxed_Value> &params) const
{
return dispatch(m_funcs.begin(), m_funcs.end(), params);
}
@@ -360,7 +360,7 @@ namespace chaiscript
{
throw std::range_error("Object not known: " + name);
} else {
Boxed_Value f(Proxy_Function(new Dispatch_Function(funcs)));
Boxed_Value f(Const_Proxy_Function(new Dispatch_Function(funcs)));
cache[name] = f;
return f;
}