diff --git a/CMakeLists.txt b/CMakeLists.txt
index d6ffca2..d6c77af 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -61,7 +61,7 @@ if(MSVC)
add_definitions(/bigobj)
endif()
else()
- add_definitions(-Wall -Wextra -Wshadow -pedantic)
+ add_definitions(-Wall -Wextra -Wshadow -pedantic -std=c++0x)
if (APPLE)
# -Wno-missing-field-initializers is for boost on macos
diff --git a/include/chaiscript/chaiscript.hpp b/include/chaiscript/chaiscript.hpp
index 0f17284..56611f3 100644
--- a/include/chaiscript/chaiscript.hpp
+++ b/include/chaiscript/chaiscript.hpp
@@ -297,8 +297,8 @@
///
/// \subsection pointerconversions Pointer / Object Conversions
///
-/// As much as possible, ChaiScript attempts to convert between &, *, const &, const *, boost::shared_ptr,
-/// boost::shared_ptr, boost::reference_wrapper, boost::reference_wrapper and value types automatically.
+/// As much as possible, ChaiScript attempts to convert between &, *, const &, const *, std::shared_ptr,
+/// std::shared_ptr, boost::reference_wrapper, boost::reference_wrapper and value types automatically.
///
/// If a chaiscript::var object was created in C++ from a pointer, it cannot be convered to a shared_ptr (this would add invalid reference counting).
/// Const may be added, but never removed.
@@ -311,10 +311,10 @@
/// void fun3(int);
/// void fun4(int &);
/// void fun5(const int &);
-/// void fun5(boost::shared_ptr);
-/// void fun6(boost::shared_ptr);
-/// void fun7(const boost::shared_ptr &);
-/// void fun8(const boost::shared_ptr &);
+/// void fun5(std::shared_ptr);
+/// void fun6(std::shared_ptr);
+/// void fun7(const std::shared_ptr &);
+/// void fun8(const std::shared_ptr &);
/// void fun9(boost::reference_wrapper);
/// void fun10(boost::reference_wrapper);
///
diff --git a/include/chaiscript/dispatchkit/bootstrap.hpp b/include/chaiscript/dispatchkit/bootstrap.hpp
index d61f338..5427ac8 100644
--- a/include/chaiscript/dispatchkit/bootstrap.hpp
+++ b/include/chaiscript/dispatchkit/bootstrap.hpp
@@ -25,9 +25,9 @@ namespace chaiscript
/// \param[in] v Boxed_Number to copy into the new object
/// \returns The newly created object.
template
- boost::shared_ptr construct_pod(Boxed_Number v)
+ std::shared_ptr construct_pod(Boxed_Number v)
{
- boost::shared_ptr p(new P1());
+ std::shared_ptr p(new P1());
Boxed_Value bv(p);
Boxed_Number nb(bv);
nb = v;
@@ -139,7 +139,7 @@ namespace chaiscript
* function variables.
*/
template
- boost::shared_ptr shared_ptr_clone(const boost::shared_ptr &p)
+ std::shared_ptr shared_ptr_clone(const std::shared_ptr &p)
{
return p;
}
@@ -148,8 +148,8 @@ namespace chaiscript
* Specific version of shared_ptr_clone just for Proxy_Functions
*/
template
- boost::shared_ptr::type>
- shared_ptr_unconst_clone(const boost::shared_ptr::type> &p)
+ std::shared_ptr::type>
+ shared_ptr_unconst_clone(const std::shared_ptr::type> &p)
{
return boost::const_pointer_cast::type>(p);
}
@@ -162,7 +162,7 @@ namespace chaiscript
* Similar to shared_ptr_clone. Used for Proxy_Function.
*/
template
- Boxed_Value ptr_assign(Boxed_Value lhs, const boost::shared_ptr &rhs)
+ Boxed_Value ptr_assign(Boxed_Value lhs, const std::shared_ptr &rhs)
{
if (lhs.is_undef()
|| (!lhs.get_type_info().is_const() && lhs.get_type_info().bare_equal(chaiscript::detail::Get_Type_Info::get())))
@@ -283,7 +283,7 @@ namespace chaiscript
static bool has_guard(const Const_Proxy_Function &t_pf)
{
- boost::shared_ptr pf = boost::dynamic_pointer_cast(t_pf);
+ std::shared_ptr pf = std::dynamic_pointer_cast(t_pf);
if (pf)
{
return pf->get_guard();
@@ -294,7 +294,7 @@ namespace chaiscript
static Const_Proxy_Function get_guard(const Const_Proxy_Function &t_pf)
{
- boost::shared_ptr pf = boost::dynamic_pointer_cast(t_pf);
+ std::shared_ptr pf = std::dynamic_pointer_cast(t_pf);
if (pf)
{
if (pf->get_guard())
@@ -312,7 +312,7 @@ namespace chaiscript
throw bv;
}
- static boost::shared_ptr bootstrap2(boost::shared_ptr e = boost::shared_ptr (new chaiscript::detail::Dispatch_Engine()))
+ static std::shared_ptr bootstrap2(std::shared_ptr e = std::shared_ptr (new chaiscript::detail::Dispatch_Engine()))
{
e->add(user_type(), "void");
return e;
diff --git a/include/chaiscript/dispatchkit/boxed_cast.hpp b/include/chaiscript/dispatchkit/boxed_cast.hpp
index e082ce3..ea188bb 100644
--- a/include/chaiscript/dispatchkit/boxed_cast.hpp
+++ b/include/chaiscript/dispatchkit/boxed_cast.hpp
@@ -31,7 +31,7 @@ namespace chaiscript
/// \returns Type equivalent to the requested type
/// \throws exception::bad_boxed_cast If the requested conversion is not possible
///
- /// boxed_cast will attempt to make conversions between value, &, *, boost::shared_ptr, boost::reference_wrapper,
+ /// boxed_cast will attempt to make conversions between value, &, *, std::shared_ptr, boost::reference_wrapper,
/// and boost::function (const and non-const) where possible. boxed_cast is used internally during function
/// dispatch. This means that all of these conversions will be attempted automatically for you during
/// ChaiScript function calls.
@@ -40,8 +40,8 @@ namespace chaiscript
/// \li const values can be extracted only as const
/// \li Boxed_Value constructed from pointer or boost::reference_wrapper can be extracted as reference,
/// pointer or value types
- /// \li Boxed_Value constructed from boost::shared_ptr or value types can be extracted as reference,
- /// pointer, value, or boost::shared_ptr types
+ /// \li Boxed_Value constructed from std::shared_ptr or value types can be extracted as reference,
+ /// pointer, value, or std::shared_ptr types
///
/// Conversions to boost::function objects are attempted as well
///
@@ -49,11 +49,11 @@ namespace chaiscript
/// \code
/// // All of the following should succeed
/// chaiscript::Boxed_Value bv(1);
- /// boost::shared_ptr spi = chaiscript::boxed_cast >(bv);
+ /// std::shared_ptr spi = chaiscript::boxed_cast >(bv);
/// int i = chaiscript::boxed_cast(bv);
/// int *ip = chaiscript::boxed_cast(bv);
/// int &ir = chaiscript::boxed_cast(bv);
- /// boost::shared_ptr cspi = chaiscript::boxed_cast >(bv);
+ /// std::shared_ptr cspi = chaiscript::boxed_cast >(bv);
/// const int ci = chaiscript::boxed_cast(bv);
/// const int *cip = chaiscript::boxed_cast(bv);
/// const int &cir = chaiscript::boxed_cast(bv);
diff --git a/include/chaiscript/dispatchkit/boxed_cast_helper.hpp b/include/chaiscript/dispatchkit/boxed_cast_helper.hpp
index ceb0178..c6e8338 100644
--- a/include/chaiscript/dispatchkit/boxed_cast_helper.hpp
+++ b/include/chaiscript/dispatchkit/boxed_cast_helper.hpp
@@ -42,9 +42,9 @@ namespace chaiscript
} else {
if (!ob.get_type_info().is_const())
{
- return boost::cref(*(boost::any_cast >(ob.get())));
+ return boost::cref(*(boost::any_cast >(ob.get())));
} else {
- return boost::cref(*(boost::any_cast >(ob.get())));
+ return boost::cref(*(boost::any_cast >(ob.get())));
}
}
}
@@ -84,9 +84,9 @@ namespace chaiscript
} else {
if (!ob.get_type_info().is_const())
{
- return (boost::any_cast >(ob.get())).get();
+ return (boost::any_cast >(ob.get())).get();
} else {
- return (boost::any_cast >(ob.get())).get();
+ return (boost::any_cast >(ob.get())).get();
}
}
}
@@ -106,7 +106,7 @@ namespace chaiscript
{
return (boost::any_cast >(ob.get())).get_pointer();
} else {
- return (boost::any_cast >(ob.get())).get();
+ return (boost::any_cast >(ob.get())).get();
}
}
};
@@ -125,68 +125,68 @@ namespace chaiscript
{
return boost::any_cast >(ob.get());
} else {
- return boost::ref(*(boost::any_cast >(ob.get())));
+ return boost::ref(*(boost::any_cast >(ob.get())));
}
}
};
/**
- * Cast_Helper_Inner for casting to a boost::shared_ptr<> type
+ * Cast_Helper_Inner for casting to a std::shared_ptr<> type
*/
template
- struct Cast_Helper_Inner >
+ struct Cast_Helper_Inner >
{
- typedef typename boost::shared_ptr Result_Type;
+ typedef typename std::shared_ptr Result_Type;
static Result_Type cast(const Boxed_Value &ob)
{
- return boost::any_cast >(ob.get());
+ return boost::any_cast >(ob.get());
}
};
/**
- * Cast_Helper_Inner for casting to a boost::shared_ptr type
+ * Cast_Helper_Inner for casting to a std::shared_ptr type
*/
template
- struct Cast_Helper_Inner >
+ struct Cast_Helper_Inner >
{
- typedef typename boost::shared_ptr Result_Type;
+ typedef typename std::shared_ptr Result_Type;
static Result_Type cast(const Boxed_Value &ob)
{
if (!ob.get_type_info().is_const())
{
- return boost::const_pointer_cast(boost::any_cast >(ob.get()));
+ return boost::const_pointer_cast(boost::any_cast >(ob.get()));
} else {
- return boost::any_cast >(ob.get());
+ return boost::any_cast >(ob.get());
}
}
};
/**
- * Cast_Helper_Inner for casting to a const boost::shared_ptr<> & type
+ * Cast_Helper_Inner for casting to a const std::shared_ptr<> & type
*/
template
- struct Cast_Helper_Inner > : Cast_Helper_Inner >
+ struct Cast_Helper_Inner > : Cast_Helper_Inner >
{
};
template
- struct Cast_Helper_Inner &> : Cast_Helper_Inner >
+ struct Cast_Helper_Inner &> : Cast_Helper_Inner >
{
};
/**
- * Cast_Helper_Inner for casting to a const boost::shared_ptr & type
+ * Cast_Helper_Inner for casting to a const std::shared_ptr & type
*/
template
- struct Cast_Helper_Inner > : Cast_Helper_Inner >
+ struct Cast_Helper_Inner > : Cast_Helper_Inner >
{
};
template
- struct Cast_Helper_Inner &> : Cast_Helper_Inner >
+ struct Cast_Helper_Inner &> : Cast_Helper_Inner >
{
};
diff --git a/include/chaiscript/dispatchkit/boxed_value.hpp b/include/chaiscript/dispatchkit/boxed_value.hpp
index d49931f..6eb1eac 100644
--- a/include/chaiscript/dispatchkit/boxed_value.hpp
+++ b/include/chaiscript/dispatchkit/boxed_value.hpp
@@ -71,14 +71,14 @@ namespace chaiscript
void *m_data_ptr;
const void *m_const_data_ptr;
bool m_is_ref;
- std::vector > m_dependencies;
+ std::vector > m_dependencies;
};
struct Object_Data
{
- static boost::shared_ptr get(Boxed_Value::Void_Type)
+ static std::shared_ptr get(Boxed_Value::Void_Type)
{
- return boost::shared_ptr (new Data(
+ return std::shared_ptr (new Data(
detail::Get_Type_Info::get(),
boost::any(),
false,
@@ -87,15 +87,15 @@ namespace chaiscript
}
template
- static boost::shared_ptr get(const boost::shared_ptr *obj)
+ static std::shared_ptr get(const std::shared_ptr *obj)
{
return get(*obj);
}
template
- static boost::shared_ptr get(const boost::shared_ptr &obj)
+ static std::shared_ptr get(const std::shared_ptr &obj)
{
- return boost::shared_ptr(new Data(
+ return std::shared_ptr(new Data(
detail::Get_Type_Info::get(),
boost::any(obj),
false,
@@ -104,15 +104,15 @@ namespace chaiscript
}
template
- static boost::shared_ptr get(T *t)
+ static std::shared_ptr get(T *t)
{
return get(boost::ref(*t));
}
template
- static boost::shared_ptr get(boost::reference_wrapper obj)
+ static std::shared_ptr get(boost::reference_wrapper obj)
{
- return boost::shared_ptr(new Data(
+ return std::shared_ptr(new Data(
detail::Get_Type_Info::get(),
boost::any(obj),
true,
@@ -121,10 +121,10 @@ namespace chaiscript
}
template
- static boost::shared_ptr get(const T& t)
+ static std::shared_ptr get(const T& t)
{
- boost::shared_ptr p(new T(t));
- return boost::shared_ptr(new Data(
+ std::shared_ptr p(new T(t));
+ return std::shared_ptr(new Data(
detail::Get_Type_Info::get(),
boost::any(p),
false,
@@ -132,9 +132,9 @@ namespace chaiscript
);
}
- static boost::shared_ptr get()
+ static std::shared_ptr get()
{
- return boost::shared_ptr (new Data(
+ return std::shared_ptr (new Data(
Type_Info(),
boost::any(),
false,
@@ -271,10 +271,10 @@ namespace chaiscript
}
private:
- boost::shared_ptr m_data;
+ std::shared_ptr m_data;
};
- /// \brief Creates a Boxed_Value. If the object passed in is a value type, it is copied. If it is a pointer, boost::shared_ptr, or boost::reference_type
+ /// \brief Creates a Boxed_Value. If the object passed in is a value type, it is copied. If it is a pointer, std::shared_ptr, or boost::reference_type
/// a copy is not made.
/// \param t The value to box
///
@@ -301,7 +301,7 @@ namespace chaiscript
template
Boxed_Value const_var_impl(const T &t)
{
- return Boxed_Value(boost::shared_ptr::type >(new T(t)));
+ return Boxed_Value(std::shared_ptr::type >(new T(t)));
}
/// \brief Takes a pointer to a value, adds const to the pointed to type and returns an immutable Boxed_Value.
@@ -315,13 +315,13 @@ namespace chaiscript
return Boxed_Value( const_cast::type *>(t) );
}
- /// \brief Takes a boost::shared_ptr to a value, adds const to the pointed to type and returns an immutable Boxed_Value.
+ /// \brief Takes a std::shared_ptr to a value, adds const to the pointed to type and returns an immutable Boxed_Value.
/// Does not copy the pointed to value.
/// \param[in] t Pointer to make immutable
/// \returns Immutable Boxed_Value
/// \sa Boxed_Value::is_const
template
- Boxed_Value const_var_impl(const boost::shared_ptr &t)
+ Boxed_Value const_var_impl(const std::shared_ptr &t)
{
return Boxed_Value( boost::const_pointer_cast::type>(t) );
}
diff --git a/include/chaiscript/dispatchkit/dispatchkit.hpp b/include/chaiscript/dispatchkit/dispatchkit.hpp
index b96d53a..0dd657a 100644
--- a/include/chaiscript/dispatchkit/dispatchkit.hpp
+++ b/include/chaiscript/dispatchkit/dispatchkit.hpp
@@ -118,7 +118,7 @@ namespace chaiscript
return *this;
}
- Module &add(const boost::shared_ptr &m)
+ Module &add(const std::shared_ptr &m)
{
m->apply(*this, *this);
return *m;
@@ -183,7 +183,7 @@ namespace chaiscript
};
/// Convenience typedef for Module objects to be added to the ChaiScript runtime
- typedef boost::shared_ptr ModulePtr;
+ typedef std::shared_ptr ModulePtr;
namespace detail
{
@@ -346,7 +346,7 @@ namespace chaiscript
typedef std::map Type_Name_Map;
typedef std::map Scope;
typedef std::deque StackData;
- typedef boost::shared_ptr Stack;
+ typedef std::shared_ptr Stack;
struct State
{
@@ -357,7 +357,7 @@ namespace chaiscript
};
Dispatch_Engine()
- : m_place_holder(boost::shared_ptr(new dispatch::Placeholder_Object()))
+ : m_place_holder(std::shared_ptr(new dispatch::Placeholder_Object()))
{
}
@@ -838,8 +838,8 @@ namespace chaiscript
const Type_Info boxed_type = user_type();
const Type_Info boxed_pod_type = user_type();
- boost::shared_ptr dynamic_lhs(boost::dynamic_pointer_cast(lhs));
- boost::shared_ptr dynamic_rhs(boost::dynamic_pointer_cast(rhs));
+ std::shared_ptr dynamic_lhs(std::dynamic_pointer_cast(lhs));
+ std::shared_ptr dynamic_rhs(std::dynamic_pointer_cast(rhs));
if (dynamic_lhs && dynamic_rhs)
{
diff --git a/include/chaiscript/dispatchkit/dynamic_cast_conversion.hpp b/include/chaiscript/dispatchkit/dynamic_cast_conversion.hpp
index dd14ff8..5d66f29 100644
--- a/include/chaiscript/dispatchkit/dynamic_cast_conversion.hpp
+++ b/include/chaiscript/dispatchkit/dynamic_cast_conversion.hpp
@@ -87,8 +87,8 @@ namespace chaiscript
// Dynamic cast out the contained boxed value, which we know is the type we want
if (t_derived.is_const())
{
- boost::shared_ptr data
- = boost::dynamic_pointer_cast(detail::Cast_Helper >::cast(t_derived));
+ std::shared_ptr data
+ = std::dynamic_pointer_cast(detail::Cast_Helper >::cast(t_derived));
if (!data)
{
throw std::bad_cast();
@@ -96,8 +96,8 @@ namespace chaiscript
return Boxed_Value(data);
} else {
- boost::shared_ptr data
- = boost::dynamic_pointer_cast(detail::Cast_Helper >::cast(t_derived));
+ std::shared_ptr data
+ = std::dynamic_pointer_cast(detail::Cast_Helper >::cast(t_derived));
if (!data)
{
@@ -136,9 +136,9 @@ namespace chaiscript
}
template
- static boost::shared_ptr create()
+ static std::shared_ptr create()
{
- boost::shared_ptr conversion(new Dynamic_Conversion_Impl());
+ std::shared_ptr conversion(new Dynamic_Conversion_Impl());
/// \todo this is a hack and a kludge. The idea is to make sure that
/// the conversion is registered both in the module's notion of the static conversion object
@@ -165,7 +165,7 @@ namespace chaiscript
}
}
- void add_conversion(const boost::shared_ptr &conversion)
+ void add_conversion(const std::shared_ptr &conversion)
{
chaiscript::detail::threading::unique_lock l(m_mutex);
@@ -219,7 +219,7 @@ namespace chaiscript
};
}
- typedef boost::shared_ptr Dynamic_Cast_Conversion;
+ typedef std::shared_ptr Dynamic_Cast_Conversion;
/// \brief Used to register a base / parent class relationship with ChaiScript. Necessary if you
/// want automatic conversions up your inheritance hierarchy.
diff --git a/include/chaiscript/dispatchkit/exception_specification.hpp b/include/chaiscript/dispatchkit/exception_specification.hpp
index 4c0d19a..ff169c3 100644
--- a/include/chaiscript/dispatchkit/exception_specification.hpp
+++ b/include/chaiscript/dispatchkit/exception_specification.hpp
@@ -128,7 +128,7 @@ namespace chaiscript
///
/// \sa chaiscript::exception_specification for creation of chaiscript::Exception_Handler objects
/// \sa \ref exceptions
- typedef boost::shared_ptr Exception_Handler;
+ typedef std::shared_ptr Exception_Handler;
/// \brief creates a chaiscript::Exception_Handler which handles one type of exception unboxing
/// \sa \ref exceptions
diff --git a/include/chaiscript/dispatchkit/function_call_detail.hpp b/include/chaiscript/dispatchkit/function_call_detail.hpp
index 49a877a..e7e7b91 100644
--- a/include/chaiscript/dispatchkit/function_call_detail.hpp
+++ b/include/chaiscript/dispatchkit/function_call_detail.hpp
@@ -95,8 +95,8 @@ namespace chaiscript
{
if (funcs.size() == 1)
{
- boost::shared_ptr > pfi =
- boost::dynamic_pointer_cast >
+ std::shared_ptr > pfi =
+ std::dynamic_pointer_cast >
(funcs[0]);
if (pfi)
diff --git a/include/chaiscript/dispatchkit/handle_return.hpp b/include/chaiscript/dispatchkit/handle_return.hpp
index e9c3261..70cc02e 100644
--- a/include/chaiscript/dispatchkit/handle_return.hpp
+++ b/include/chaiscript/dispatchkit/handle_return.hpp
@@ -44,27 +44,27 @@ namespace chaiscript
};
template
- struct Handle_Return &>
+ struct Handle_Return &>
{
- static Boxed_Value handle(const boost::shared_ptr &r)
+ static Boxed_Value handle(const std::shared_ptr &r)
{
return Boxed_Value(r);
}
};
template
- struct Handle_Return >
+ struct Handle_Return >
{
- static Boxed_Value handle(const boost::shared_ptr &r)
+ static Boxed_Value handle(const std::shared_ptr &r)
{
return Boxed_Value(r);
}
};
template
- struct Handle_Return &>
+ struct Handle_Return &>
{
- static Boxed_Value handle(const boost::shared_ptr &r)
+ static Boxed_Value handle(const std::shared_ptr &r)
{
return Boxed_Value(r);
}
diff --git a/include/chaiscript/dispatchkit/proxy_constructors.hpp b/include/chaiscript/dispatchkit/proxy_constructors.hpp
index fcd019b..6c6e542 100644
--- a/include/chaiscript/dispatchkit/proxy_constructors.hpp
+++ b/include/chaiscript/dispatchkit/proxy_constructors.hpp
@@ -55,9 +55,9 @@ namespace chaiscript
* of a given type with a given set of params
*/
template
- boost::shared_ptr constructor_( BOOST_PP_ENUM_BINARY_PARAMS(n, Param, p) )
+ std::shared_ptr constructor_( BOOST_PP_ENUM_BINARY_PARAMS(n, Param, p) )
{
- return boost::shared_ptr(new Class( BOOST_PP_ENUM_PARAMS(n, p) ));
+ return std::shared_ptr(new Class( BOOST_PP_ENUM_PARAMS(n, p) ));
}
/**
@@ -69,7 +69,7 @@ namespace chaiscript
template
Proxy_Function build_constructor_(Class (*)(BOOST_PP_ENUM_PARAMS(n, Param)))
{
- typedef boost::shared_ptr (sig)(BOOST_PP_ENUM_PARAMS(n, Param));
+ typedef std::shared_ptr (sig)(BOOST_PP_ENUM_PARAMS(n, Param));
return Proxy_Function(new Proxy_Function_Impl(boost::function(&(constructor_))));
}
}
diff --git a/include/chaiscript/dispatchkit/proxy_functions.hpp b/include/chaiscript/dispatchkit/proxy_functions.hpp
index b6bb7e0..300a021 100644
--- a/include/chaiscript/dispatchkit/proxy_functions.hpp
+++ b/include/chaiscript/dispatchkit/proxy_functions.hpp
@@ -23,7 +23,7 @@ namespace chaiscript
class Boxed_Number;
struct AST_Node;
- typedef boost::shared_ptr AST_NodePtr;
+ typedef std::shared_ptr AST_NodePtr;
namespace dispatch
@@ -87,9 +87,9 @@ namespace chaiscript
virtual bool operator==(const Proxy_Function_Base &) const = 0;
virtual bool call_match(const std::vector &vals) const = 0;
- virtual std::vector > get_contained_functions() const
+ virtual std::vector > get_contained_functions() const
{
- return std::vector >();
+ return std::vector