diff --git a/luabind/std_shared_ptr_converter.hpp b/luabind/std_shared_ptr_converter.hpp new file mode 100644 index 00000000..fcc6a4c5 --- /dev/null +++ b/luabind/std_shared_ptr_converter.hpp @@ -0,0 +1,51 @@ +#ifndef STD_SHAREDPTR_CONVERTER_HPP_INCLUDED +#define STD_SHAREDPTR_CONVERTER_HPP_INCLUDED STD_SHAREDPTR_CONVERTER_HPP_INCLUDED + +#include + +#if BOOST_VERSION >= 105300 +#include + + +namespace luabind { namespace detail { namespace has_get_pointer_ { + template + struct impl> { + BOOST_STATIC_CONSTANT(bool, value = true); + typedef boost::mpl::bool_ type; + }; + + template + struct impl>: impl> { }; + + template + struct impl>: impl> { }; + + template + struct impl>: impl> { }; +}} +using boost::get_pointer; +} + + + +#else // if BOOST_VERSION < 105300 + +// Not standard conforming: add function to ::std(::tr1) +namespace std { + +#if defined(_MSC_VER) && _MSC_VER < 1700 +namespace tr1 { +#endif + + template + T * get_pointer(shared_ptr const& p) { return p.get(); } + +#if defined(_MSC_VER) && _MSC_VER < 1700 +} // namespace tr1 +#endif + +} // namespace std + +#endif // if BOOST_VERSION < 105300 + +#endif