use a global void value for returning unknown values

This commit is contained in:
Jason Turner
2016-03-11 10:21:39 -07:00
parent cd1b3f8887
commit 5247de7d1b
3 changed files with 18 additions and 13 deletions

View File

@@ -411,6 +411,11 @@ namespace chaiscript
return detail::const_var_impl(t);
}
inline Boxed_Value void_var() {
static const auto v = Boxed_Value(Boxed_Value::Void_Type());
return v;
}
inline Boxed_Value const_var(bool b) {
static const auto t = detail::const_var_impl(true);
static const auto f = detail::const_var_impl(false);