Add support for boxed_cast<> to const boost::shared_ptr<Type> &, fixing the problem Jon was having

This commit is contained in:
Jason Turner
2009-07-16 21:30:01 +00:00
parent 3fc5f8e8e1
commit 727dc7b0d6

View File

@@ -438,6 +438,21 @@ namespace dispatchkit
}
};
/**
* Cast_Helper for casting to a boost::shared_ptr<> type
*/
template<typename Result>
struct Cast_Helper<typename const boost::shared_ptr<Result> &>
{
typedef typename boost::shared_ptr<Result> Result_Type;
static Result_Type cast(const Boxed_Value &ob)
{
return boost::any_cast<boost::shared_ptr<Result> >(ob.get());
}
};
/**
* Cast_Helper for casting to a Boxed_Value type