Add "is_null" for boxed_values to see if they contain a null shared_ptr value

This commit is contained in:
Jason Turner
2009-11-08 16:30:12 +00:00
parent 3a37ceedb7
commit cbc61d898c
3 changed files with 31 additions and 6 deletions

View File

@@ -709,6 +709,7 @@ namespace chaiscript
m->eval("def Dynamic_Object::clone() { var new_o := Dynamic_Object(this.get_type_name()); for_each(this.get_attrs(), bind(fun(new_o, x) { new_o.get_attr(x.first) = x.second; }, new_o, _) ); return new_o; }");
m->add(fun(&Boxed_Value::is_undef), "is_undef");
m->add(fun(&Boxed_Value::is_null), "is_null");
basic_constructors<bool>("bool", m);
oper_assign<std::string>(m);