Add "type_name" function and port the "new" in prelude to use it instead of clone/clear.
This commit is contained in:
@@ -463,7 +463,7 @@ namespace chaiscript
|
||||
/**
|
||||
* return true if the Boxed_Value matches the registered type by name
|
||||
*/
|
||||
static bool is_type(const Dispatch_Engine &e, const std::string &user_typename, Boxed_Value r)
|
||||
bool is_type(const Dispatch_Engine &e, const std::string &user_typename, Boxed_Value r)
|
||||
{
|
||||
try {
|
||||
return e.get_type(user_typename) == r.get_type_info();
|
||||
@@ -472,6 +472,11 @@ namespace chaiscript
|
||||
}
|
||||
}
|
||||
|
||||
std::string type_name(const Dispatch_Engine &e, Boxed_Value obj)
|
||||
{
|
||||
return e.get_type_name(obj.get_type_info());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user