Eliminate use of boost::shared_ptr

This commit is contained in:
Jason Turner
2011-09-10 07:24:46 -06:00
parent afa96ecbf9
commit e2da56f199
5 changed files with 6 additions and 6 deletions

View File

@@ -151,7 +151,7 @@ namespace chaiscript
std::shared_ptr<typename boost::remove_const<Type>::type> std::shared_ptr<typename boost::remove_const<Type>::type>
shared_ptr_unconst_clone(const std::shared_ptr<typename boost::add_const<Type>::type> &p) shared_ptr_unconst_clone(const std::shared_ptr<typename boost::add_const<Type>::type> &p)
{ {
return boost::const_pointer_cast<typename boost::remove_const<Type>::type>(p); return std::const_pointer_cast<typename boost::remove_const<Type>::type>(p);
} }
@@ -286,7 +286,7 @@ namespace chaiscript
std::shared_ptr<const dispatch::Dynamic_Proxy_Function> pf = std::dynamic_pointer_cast<const dispatch::Dynamic_Proxy_Function>(t_pf); std::shared_ptr<const dispatch::Dynamic_Proxy_Function> pf = std::dynamic_pointer_cast<const dispatch::Dynamic_Proxy_Function>(t_pf);
if (pf) if (pf)
{ {
return pf->get_guard(); return bool(pf->get_guard());
} else { } else {
return false; return false;
} }

View File

@@ -156,7 +156,7 @@ namespace chaiscript
{ {
if (!ob.get_type_info().is_const()) if (!ob.get_type_info().is_const())
{ {
return boost::const_pointer_cast<const Result>(boost::any_cast<std::shared_ptr<Result> >(ob.get())); return std::const_pointer_cast<const Result>(boost::any_cast<std::shared_ptr<Result> >(ob.get()));
} else { } else {
return boost::any_cast<std::shared_ptr<const Result> >(ob.get()); return boost::any_cast<std::shared_ptr<const Result> >(ob.get());
} }

View File

@@ -323,7 +323,7 @@ namespace chaiscript
template<typename T> template<typename T>
Boxed_Value const_var_impl(const std::shared_ptr<T> &t) Boxed_Value const_var_impl(const std::shared_ptr<T> &t)
{ {
return Boxed_Value( boost::const_pointer_cast<typename boost::add_const<T>::type>(t) ); return Boxed_Value( std::const_pointer_cast<typename boost::add_const<T>::type>(t) );
} }
/// \brief Takes a boost::reference_wrapper value, adds const to the referenced type and returns an immutable Boxed_Value. /// \brief Takes a boost::reference_wrapper value, adds const to the referenced type and returns an immutable Boxed_Value.

View File

@@ -102,7 +102,7 @@ namespace chaiscript
/// \brief Struct that doubles as both a parser ast_node and an AST node. /// \brief Struct that doubles as both a parser ast_node and an AST node.
struct AST_Node : boost::enable_shared_from_this<AST_Node> { struct AST_Node : std::enable_shared_from_this<AST_Node> {
public: public:
const std::string text; const std::string text;
const int identifier; const int identifier;

View File

@@ -18,7 +18,7 @@ bool has_parse_tree(const chaiscript::Const_Proxy_Function &t_pf)
= std::dynamic_pointer_cast<const chaiscript::dispatch::Dynamic_Proxy_Function>(t_pf); = std::dynamic_pointer_cast<const chaiscript::dispatch::Dynamic_Proxy_Function>(t_pf);
if (pf) if (pf)
{ {
return pf->get_parse_tree(); return bool(pf->get_parse_tree());
} else { } else {
return false; return false;
} }