Fix operator shared_ptr<T> for the Value class

fixes #7586
This commit is contained in:
Gunnar Beutner 2014-11-05 16:09:22 +01:00
parent 32b0429904
commit cfc418c9eb
1 changed files with 7 additions and 2 deletions

View File

@ -99,12 +99,17 @@ public:
if (IsEmpty())
return shared_ptr<T>();
shared_ptr<T> object = dynamic_pointer_cast<T>(boost::get<Object::Ptr>(m_Value));
Object::Ptr object = boost::get<Object::Ptr>(m_Value);
if (!object)
return shared_ptr<T>();
shared_ptr<T> tobject = dynamic_pointer_cast<T>(object);
if (!tobject)
BOOST_THROW_EXCEPTION(std::bad_cast());
return object;
return tobject;
}
bool IsEmpty(void) const;