mirror of
https://github.com/ChaiScript/ChaiScript.git
synced 2025-12-06 16:57:04 +08:00
Fix double pointer cast test
This commit is contained in:
parent
79181fe41e
commit
5114ca9d35
@ -81,16 +81,17 @@ namespace chaiscript
|
||||
typedef Result * Result_Type;
|
||||
static Result_Type cast(const Boxed_Value &ob, const Type_Conversions *)
|
||||
{
|
||||
if (!ob.get_type_info().is_const() && ob.get_type_info().bare_equal_type_info(typeid(Result)))
|
||||
if (ob.is_ref())
|
||||
{
|
||||
return static_cast<Result *>(throw_if_null(ob.get_ptr()));
|
||||
return &(ob.get().cast<std::reference_wrapper<Result> >()).get();
|
||||
} else {
|
||||
throw chaiscript::detail::exception::bad_any_cast();
|
||||
return (ob.get().cast<std::shared_ptr<Result> >()).get();
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
|
||||
/// Cast_Helper_Inner for casting to a & type
|
||||
template<typename Result>
|
||||
struct Cast_Helper_Inner<Result &>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user