From 727dc7b0d6d64fb5c5e68c66a2b77954ec4482b2 Mon Sep 17 00:00:00 2001 From: Jason Turner Date: Thu, 16 Jul 2009 21:30:01 +0000 Subject: [PATCH] Add support for boxed_cast<> to const boost::shared_ptr &, fixing the problem Jon was having --- include/chaiscript/dispatchkit/boxed_value.hpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/include/chaiscript/dispatchkit/boxed_value.hpp b/include/chaiscript/dispatchkit/boxed_value.hpp index 528c8c7..e36c609 100644 --- a/include/chaiscript/dispatchkit/boxed_value.hpp +++ b/include/chaiscript/dispatchkit/boxed_value.hpp @@ -438,6 +438,21 @@ namespace dispatchkit } }; + /** + * Cast_Helper for casting to a boost::shared_ptr<> type + */ + template + struct Cast_Helper &> + { + typedef typename boost::shared_ptr Result_Type; + + static Result_Type cast(const Boxed_Value &ob) + { + return boost::any_cast >(ob.get()); + } + }; + + /** * Cast_Helper for casting to a Boxed_Value type