Update of /cvsroot/luabind/luabind/luabind/examples/any_converter
In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv21107
Modified Files:
any_converter.cpp
Log Message:
fixed any_converter example
Index: any_converter.cpp
===================================================================
RCS file: /cvsroot/luabind/luabind/luabind/examples/any_converter/any_converter.cpp,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- any_converter.cpp 28 Nov 2005 20:55:34 -0000 1.4
+++ any_converter.cpp 10 Jul 2006 13:41:23 -0000 1.5
@@ -20,6 +20,7 @@
}
#include <luabind/luabind.hpp>
+#include <luabind/detail/convert_to_lua.hpp>
#include <boost/any.hpp>
template<class T>
@@ -27,9 +28,7 @@
{
static void convert(lua_State* L, const boost::any& a)
{
- typename luabind::detail::default_policy::template generate_converter<T, luabind::detail::cpp_to_lua>::type conv;
-
- conv.apply(L, *boost::any_cast<T>(&a));
+ luabind::detail::convert_to_lua(L, *boost::any_cast<T>(&a));
}
};
@@ -71,7 +70,11 @@
register_any_converter<std::string>();
lua_State* L = lua_open();
+#if LUA_VERSION_NUM >= 501
+ luaL_openlibs(L);
+#else
lua_baselibopen(L);
+#endif
using namespace luabind;
|