luabind-cvs Mailing List for luabind (Page 5)
Brought to you by:
arvidn,
daniel_wallin
You can subscribe to this list here.
2005 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(7) |
Oct
(53) |
Nov
(13) |
Dec
(14) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2006 |
Jan
(15) |
Feb
(1) |
Mar
(6) |
Apr
|
May
(5) |
Jun
(7) |
Jul
(5) |
Aug
|
Sep
(2) |
Oct
(5) |
Nov
|
Dec
|
From: Daniel W. <dan...@us...> - 2005-10-22 10:51:38
|
Update of /cvsroot/luabind/luabind/luabind/luabind/detail In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14305/detail Modified Files: Tag: beta7-devel2 signature_match.hpp Log Message: Fixed a few typename issues on VC6.0. Index: signature_match.hpp =================================================================== RCS file: /cvsroot/luabind/luabind/luabind/luabind/detail/signature_match.hpp,v retrieving revision 1.3.2.3 retrieving revision 1.3.2.4 diff -u -d -r1.3.2.3 -r1.3.2.4 --- signature_match.hpp 19 Oct 2005 11:46:43 -0000 1.3.2.3 +++ signature_match.hpp 22 Oct 2005 10:51:22 -0000 1.3.2.4 @@ -190,7 +190,7 @@ , Policies const*) { typedef constructor< - typename most_derived<T,WrappedClass>::type& + BOOST_DEDUCED_TYPENAME most_derived<T,WrappedClass>::type& BOOST_PP_ENUM_TRAILING_PARAMS(N, A) > params_t; @@ -214,7 +214,7 @@ , Policies const* policies) { typedef constructor< - typename most_derived<T,WrappedClass>::type const& + BOOST_DEDUCED_TYPENAME most_derived<T,WrappedClass>::type const& BOOST_PP_ENUM_TRAILING_PARAMS(N, A) > params_t; return match_params( |
From: Daniel W. <dan...@us...> - 2005-10-22 10:50:12
|
Update of /cvsroot/luabind/luabind/luabind/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14005 Modified Files: Tag: beta7-devel2 test_lua_classes.cpp Log Message: Removed test case that been moved to separate file. Index: test_lua_classes.cpp =================================================================== RCS file: /cvsroot/luabind/luabind/luabind/test/test_lua_classes.cpp,v retrieving revision 1.26.2.3 retrieving revision 1.26.2.4 diff -u -d -r1.26.2.3 -r1.26.2.4 --- test_lua_classes.cpp 18 Oct 2005 16:03:25 -0000 1.26.2.3 +++ test_lua_classes.cpp 22 Oct 2005 10:50:02 -0000 1.26.2.4 @@ -136,15 +136,6 @@ int f(int, int) { return 2; } }; -struct V -{ - int f(int,int) { return 2; } -}; - -struct W : V -{ -}; - void test_main(lua_State* L) { module(L) @@ -172,34 +163,16 @@ class_<U, T_>("U") .def(constructor<>()) .def("f", &U::f) - .def("g", &U::g), - - class_<W>("W") - .def(constructor<>()) - .def("f", &V::f) + .def("g", &U::g) ]; - - try - { - dostring(L, "u = U()\n" + + DOSTRING(L, + "u = U()\n" "assert(u:f(0) == 1)\n" "assert(u:f(0,0) == 2)\n" "assert(u:g() == 3)\n"); - } - catch (luabind::error const& e) - { - TEST_ERROR(lua_tostring(e.state(), -1)); - } - catch (std::string const& s) - { - TEST_ERROR(s.c_str()); - } DOSTRING(L, - "w = W()\n" - "assert(w:f(1,1) == 2)"); - - DOSTRING(L, "u = U()\n" "assert(u:f(0) == 1)\n" "assert(u:f(0,0) == 2)\n" |
From: Arvid N. <ar...@us...> - 2005-10-22 10:42:42
|
Update of /cvsroot/luabind/luabind/luabind/doc In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12817/doc Modified Files: Tag: beta7-devel2 docs.rst Log Message: fixed holder-extractor typo Index: docs.rst =================================================================== RCS file: /cvsroot/luabind/luabind/luabind/doc/docs.rst,v retrieving revision 1.25.2.8 retrieving revision 1.25.2.9 diff -u -d -r1.25.2.8 -r1.25.2.9 --- docs.rst 3 Aug 2005 14:41:20 -0000 1.25.2.8 +++ docs.rst 22 Oct 2005 10:42:33 -0000 1.25.2.9 @@ -807,7 +807,7 @@ namespace luabind { template<class T> - T* get_pointer(boost::shared_ptr<T> const& p) + T* get_pointer(boost::shared_ptr<T>& p) { return p.get(); } |
From: Arvid N. <ar...@us...> - 2005-10-22 10:42:42
|
Update of /cvsroot/luabind/luabind/luabind/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12817/test Modified Files: Tag: beta7-devel2 Jamfile Log Message: fixed holder-extractor typo Index: Jamfile =================================================================== RCS file: /cvsroot/luabind/luabind/luabind/test/Jamfile,v retrieving revision 1.15.2.6 retrieving revision 1.15.2.7 diff -u -d -r1.15.2.6 -r1.15.2.7 --- Jamfile 19 Oct 2005 12:01:43 -0000 1.15.2.6 +++ Jamfile 22 Oct 2005 10:42:33 -0000 1.15.2.7 @@ -22,6 +22,7 @@ test_separation.cpp test_simple_class.cpp test_yield.cpp + test_yield2.cpp ; project : default-build <link>static ; |
From: Daniel W. <dan...@us...> - 2005-10-22 10:31:32
|
Update of /cvsroot/luabind/luabind/luabind/luabind In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10658 Modified Files: Tag: beta7-devel2 object.hpp Log Message: Fixed ICE on VC6.0. Index: object.hpp =================================================================== RCS file: /cvsroot/luabind/luabind/luabind/luabind/object.hpp,v retrieving revision 1.34.2.19 retrieving revision 1.34.2.20 diff -u -d -r1.34.2.19 -r1.34.2.20 --- object.hpp 19 Oct 2005 16:27:33 -0000 1.34.2.19 +++ object.hpp 22 Oct 2005 10:31:19 -0000 1.34.2.20 @@ -52,7 +52,7 @@ { typedef typename boost::mpl::if_< boost::is_reference_wrapper<T> - , typename boost::unwrap_reference<T>::type& + , BOOST_DEDUCED_TYPENAME boost::unwrap_reference<T>::type& , T >::type unwrapped_type; @@ -63,7 +63,9 @@ cv.apply( interpreter - , boost::implicit_cast<typename boost::unwrap_reference<T>::type&>(value) + , boost::implicit_cast< + BOOST_DEDUCED_TYPENAME boost::unwrap_reference<T>::type& + >(value) ); } @@ -482,7 +484,6 @@ this_type& operator=(T const& value) { value_wrapper_traits<Next>::unwrap(m_interpreter, m_next); - detail::stack_pop pop(m_interpreter, 1); lua_pushvalue(m_interpreter, m_key_index); @@ -596,23 +597,19 @@ // An object holds a reference to a Lua value residing // in the registry. - class object : object_init, public object_interface<object> + class object : public object_interface<object> { struct safe_bool_type {}; public: object() {} -#if !BOOST_WORKAROUND(BOOST_MSVC, == 1200) - explicit object(from_stack const& stack_reference) - : object_init(stack_reference, boost::mpl::true_()) - { - } -#endif + explicit object(handle const& other) + : m_handle(other) + {} - template<class ValueWrapper> - explicit object(ValueWrapper const& value_wrapper) - : object_init(value_wrapper, boost::is_same<ValueWrapper,from_stack>()) + explicit object(from_stack const& stack_reference) + : m_handle(stack_reference.interpreter, stack_reference.index) { } @@ -651,6 +648,7 @@ } private: + handle m_handle; }; inline void object::push(lua_State* interpreter) const @@ -741,12 +739,14 @@ , class ValueWrapper , class Policies , class ErrorPolicy + , class ReturnType > - typename ErrorPolicy::type object_cast_aux( + ReturnType object_cast_aux( ValueWrapper const& value_wrapper , T* , Policies* , ErrorPolicy* + , ReturnType* ) { lua_State* interpreter = value_wrapper_traits<ValueWrapper>::interpreter( @@ -785,8 +785,6 @@ template<class T> struct throw_error_policy { - typedef T type; - static T handle_error(lua_State* interpreter, LUABIND_TYPE_INFO type_info) { #ifndef LUABIND_NO_EXCEPTIONS @@ -805,11 +803,9 @@ template<class T> struct nothrow_error_policy { - typedef boost::optional<T> type; - - static type handle_error(lua_State*, LUABIND_TYPE_INFO) + static boost::optional<T> handle_error(lua_State*, LUABIND_TYPE_INFO) { - return type(); + return boost::optional<T>(); } }; @@ -823,6 +819,7 @@ , (T*)0 , (detail::null_type*)0 , (detail::throw_error_policy<T>*)0 + , (T*)0 ); } @@ -834,6 +831,7 @@ , (T*)0 , (Policies*)0 , (detail::throw_error_policy<T>*)0 + , (T*)0 ); } @@ -845,6 +843,7 @@ , (T*)0 , (detail::null_type*)0 , (detail::nothrow_error_policy<T>*)0 + , (boost::optional<T>*)0 ); } @@ -856,18 +855,13 @@ , (T*)0 , (Policies*)0 , (detail::nothrow_error_policy<T>*)0 + , (boost::optional<T>*)0 ); } namespace detail { - template<class T> - void convert_to_lua(lua_State*, const T&); - - template<int Index, class T, class Policies> - void convert_to_lua_p(lua_State*, const T&, const Policies&); - template<int Index> struct push_args_from_tuple { |
From: Daniel W. <dan...@us...> - 2005-10-19 16:27:46
|
Update of /cvsroot/luabind/luabind/luabind/luabind In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25228 Modified Files: Tag: beta7-devel2 object.hpp Log Message: Overload resolution fix for VC6.5. Index: object.hpp =================================================================== RCS file: /cvsroot/luabind/luabind/luabind/luabind/object.hpp,v retrieving revision 1.34.2.18 retrieving revision 1.34.2.19 diff -u -d -r1.34.2.18 -r1.34.2.19 --- object.hpp 19 Oct 2005 11:49:02 -0000 1.34.2.18 +++ object.hpp 19 Oct 2005 16:27:33 -0000 1.34.2.19 @@ -567,22 +567,19 @@ namespace adl { - // An object holds a reference to a Lua value residing - // in the registry. - class object : public object_interface<object> + class object_init { - struct safe_bool_type {}; - public: - object() + protected: + object_init() {} - - explicit object(from_stack const& stack_reference) + + explicit object_init(from_stack const& stack_reference, boost::mpl::true_) : m_handle(stack_reference.interpreter, stack_reference.index) { } template<class ValueWrapper> - explicit object(ValueWrapper const& value_wrapper) + explicit object_init(ValueWrapper const& value_wrapper, boost::mpl::false_) { lua_State* interpreter = value_wrapper_traits<ValueWrapper>::interpreter( value_wrapper @@ -594,6 +591,31 @@ handle(interpreter, -1).swap(m_handle); } + handle m_handle; + }; + + // An object holds a reference to a Lua value residing + // in the registry. + class object : object_init, public object_interface<object> + { + struct safe_bool_type {}; + public: + object() + {} + +#if !BOOST_WORKAROUND(BOOST_MSVC, == 1200) + explicit object(from_stack const& stack_reference) + : object_init(stack_reference, boost::mpl::true_()) + { + } +#endif + + template<class ValueWrapper> + explicit object(ValueWrapper const& value_wrapper) + : object_init(value_wrapper, boost::is_same<ValueWrapper,from_stack>()) + { + } + template<class T> object(lua_State* interpreter, T const& value) { @@ -629,7 +651,6 @@ } private: - handle m_handle; }; inline void object::push(lua_State* interpreter) const |
From: Daniel W. <dan...@us...> - 2005-10-19 16:14:10
|
Update of /cvsroot/luabind/luabind/luabind/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22371 Modified Files: Tag: beta7-devel2 test_value_wrapper.cpp Log Message: Added a few more tests to test_value_wrapper. Index: test_value_wrapper.cpp =================================================================== RCS file: /cvsroot/luabind/luabind/luabind/test/Attic/test_value_wrapper.cpp,v retrieving revision 1.1.2.3 retrieving revision 1.1.2.4 diff -u -d -r1.1.2.3 -r1.1.2.4 --- test_value_wrapper.cpp 19 Oct 2005 12:01:43 -0000 1.1.2.3 +++ test_value_wrapper.cpp 19 Oct 2005 16:14:02 -0000 1.1.2.4 @@ -21,6 +21,7 @@ // OR OTHER DEALINGS IN THE SOFTWARE. #include <luabind/value_wrapper.hpp> +#include <luabind/object.hpp> #include <boost/mpl/assert.hpp> struct X_tag; @@ -50,6 +51,9 @@ } // namespace luabind BOOST_MPL_ASSERT(( luabind::is_value_wrapper<X> )); +BOOST_MPL_ASSERT_NOT(( luabind::is_value_wrapper<X&> )); +BOOST_MPL_ASSERT_NOT(( luabind::is_value_wrapper<X const&> )); + BOOST_MPL_ASSERT(( luabind::is_value_wrapper_arg<X> )); BOOST_MPL_ASSERT(( luabind::is_value_wrapper_arg<X const> )); BOOST_MPL_ASSERT(( luabind::is_value_wrapper_arg<X&> )); @@ -57,8 +61,9 @@ BOOST_MPL_ASSERT_NOT(( luabind::is_value_wrapper_arg<int> )); BOOST_MPL_ASSERT_NOT(( luabind::is_value_wrapper_arg<int[4]> )); -BOOST_MPL_ASSERT_NOT(( luabind::is_value_wrapper<X&> )); -BOOST_MPL_ASSERT_NOT(( luabind::is_value_wrapper<X const&> )); +BOOST_MPL_ASSERT(( luabind::is_value_wrapper_arg<X const&> )); +BOOST_MPL_ASSERT(( luabind::is_value_wrapper_arg<luabind::object&> )); +BOOST_MPL_ASSERT(( luabind::is_value_wrapper_arg<luabind::object const&> )); int main() { |
From: Daniel W. <dan...@us...> - 2005-10-19 16:12:17
|
Update of /cvsroot/luabind/luabind/luabind/luabind In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21955 Modified Files: Tag: beta7-devel2 value_wrapper.hpp Log Message: Fixed is_value_wrapper_arg for VC7.0. Index: value_wrapper.hpp =================================================================== RCS file: /cvsroot/luabind/luabind/luabind/luabind/Attic/value_wrapper.hpp,v retrieving revision 1.1.2.8 retrieving revision 1.1.2.9 diff -u -d -r1.1.2.8 -r1.1.2.9 --- value_wrapper.hpp 19 Oct 2005 12:02:11 -0000 1.1.2.8 +++ value_wrapper.hpp 19 Oct 2005 16:12:09 -0000 1.1.2.9 @@ -134,8 +134,8 @@ namespace detail { template<class T> - typename is_value_wrapper<T>::type is_value_wrapper_arg_check(T const volatile*); - + typename is_value_wrapper<T>::type is_value_wrapper_arg_check(T const*); + yes_t to_yesno(boost::mpl::true_); no_t to_yesno(boost::mpl::false_); |
From: Daniel W. <dan...@us...> - 2005-10-19 15:19:47
|
Update of /cvsroot/luabind/luabind/luabind/luabind/detail In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6307/detail Modified Files: Tag: beta7-devel2 constructor.hpp other.hpp Log Message: Fixed typos. Index: constructor.hpp =================================================================== RCS file: /cvsroot/luabind/luabind/luabind/luabind/detail/constructor.hpp,v retrieving revision 1.7.2.1 retrieving revision 1.7.2.2 diff -u -d -r1.7.2.1 -r1.7.2.2 --- constructor.hpp 19 Oct 2005 11:46:43 -0000 1.7.2.1 +++ constructor.hpp 19 Oct 2005 15:19:39 -0000 1.7.2.2 @@ -103,7 +103,7 @@ { template<class T, class Policies, BOOST_PP_ENUM_PARAMS(LUABIND_MAX_ARITY, class A)> static T* execute( - lua_State* + lua_State* L , weak_ref const& , T* , constructor<BOOST_PP_ENUM_PARAMS(LUABIND_MAX_ARITY,A)>* Index: other.hpp =================================================================== RCS file: /cvsroot/luabind/luabind/luabind/luabind/detail/other.hpp,v retrieving revision 1.2 retrieving revision 1.2.4.1 diff -u -d -r1.2 -r1.2.4.1 --- other.hpp 14 Jun 2003 21:05:02 -0000 1.2 +++ other.hpp 19 Oct 2005 15:19:39 -0000 1.2.4.1 @@ -74,7 +74,7 @@ no_other_t is_other_test(...); template<typename T> - yes_other_t is_other_test(type< other<T> >); + yes_other_t is_other_test(type_< other<T> >); template<bool wrapped> struct other_unwrapper @@ -102,7 +102,7 @@ public: BOOST_STATIC_CONSTANT( bool, value = ( - sizeof(detail::is_other_test(type<T>())) + sizeof(detail::is_other_test(type_<T>())) == sizeof(detail::yes_other_t))); }; |
From: Daniel W. <dan...@us...> - 2005-10-19 12:02:21
|
Update of /cvsroot/luabind/luabind/luabind/luabind In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18613 Modified Files: Tag: beta7-devel2 value_wrapper.hpp Log Message: Fixed is_value_wrapper_arg for compilers that has LUABIND_USE_VALUE_WRAPPER_TAG defined. Index: value_wrapper.hpp =================================================================== RCS file: /cvsroot/luabind/luabind/luabind/luabind/Attic/value_wrapper.hpp,v retrieving revision 1.1.2.7 retrieving revision 1.1.2.8 diff -u -d -r1.1.2.7 -r1.1.2.8 --- value_wrapper.hpp 30 Sep 2005 11:19:41 -0000 1.1.2.7 +++ value_wrapper.hpp 19 Oct 2005 12:02:11 -0000 1.1.2.8 @@ -127,33 +127,25 @@ #else # include <luabind/detail/yes_no.hpp> +# include <boost/type_traits/add_reference.hpp> namespace luabind { namespace detail { template<class T> - typename is_value_wrapper<T>::type - is_value_wrapper_arg_check(void(*)(T), ...); - - template<class T> - typename is_value_wrapper<T>::type - is_value_wrapper_arg_check(void(*)(T&), int); - - template<class T> - typename is_value_wrapper<T>::type - is_value_wrapper_arg_check(void(*)(T const&), long); - - boost::mpl::false_ is_value_wrapper_arg_check(...); + typename is_value_wrapper<T>::type is_value_wrapper_arg_check(T const volatile*); yes_t to_yesno(boost::mpl::true_); no_t to_yesno(boost::mpl::false_); - + template<class T> struct is_value_wrapper_arg_aux { + static typename boost::add_reference<T>::type x; + BOOST_STATIC_CONSTANT(bool, value = - sizeof(to_yesno(is_value_wrapper_arg_check((void(*)(T))0, 0L))) + sizeof(to_yesno(is_value_wrapper_arg_check(&x))) == sizeof(yes_t) ); |
From: Daniel W. <dan...@us...> - 2005-10-19 12:01:55
|
Update of /cvsroot/luabind/luabind/luabind/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18255 Modified Files: Tag: beta7-devel2 Jamfile test_value_wrapper.cpp Log Message: Made test_value_wrapper a compile only test. Changed test so that compilers that has LUABIND_USE_VALUE_WRAPPER_TAG defined are properly tested. Index: test_value_wrapper.cpp =================================================================== RCS file: /cvsroot/luabind/luabind/luabind/test/Attic/test_value_wrapper.cpp,v retrieving revision 1.1.2.2 retrieving revision 1.1.2.3 diff -u -d -r1.1.2.2 -r1.1.2.3 --- test_value_wrapper.cpp 10 Oct 2005 00:39:51 -0000 1.1.2.2 +++ test_value_wrapper.cpp 19 Oct 2005 12:01:43 -0000 1.1.2.3 @@ -32,20 +32,20 @@ namespace luabind { - +#ifdef LUABIND_USE_VALUE_WRAPPER_TAG template<> struct value_wrapper_traits<X_tag> { typedef boost::mpl::true_ is_specialized; }; - +#else // used on compilers supporting partial template specialization template<> struct value_wrapper_traits<X> { typedef boost::mpl::true_ is_specialized; }; - +#endif } // namespace luabind Index: Jamfile =================================================================== RCS file: /cvsroot/luabind/luabind/luabind/test/Jamfile,v retrieving revision 1.15.2.5 retrieving revision 1.15.2.6 diff -u -d -r1.15.2.5 -r1.15.2.6 --- Jamfile 19 Oct 2005 11:36:15 -0000 1.15.2.5 +++ Jamfile 19 Oct 2005 12:01:43 -0000 1.15.2.6 @@ -22,7 +22,6 @@ test_separation.cpp test_simple_class.cpp test_yield.cpp - test_value_wrapper.cpp ; project : default-build <link>static ; @@ -41,5 +40,6 @@ test-suite luabind-test : $(tests) [ compile test_typetraits.cpp ] + [ compile test_value_wrapper.cpp ] ; |
From: Daniel W. <dan...@us...> - 2005-10-19 11:49:14
|
Update of /cvsroot/luabind/luabind/luabind/luabind In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16177 Modified Files: Tag: beta7-devel2 object.hpp Log Message: ADL workaround is now used on all compilers. Index: object.hpp =================================================================== RCS file: /cvsroot/luabind/luabind/luabind/luabind/object.hpp,v retrieving revision 1.34.2.17 retrieving revision 1.34.2.18 diff -u -d -r1.34.2.17 -r1.34.2.18 --- object.hpp 30 Sep 2005 11:28:42 -0000 1.34.2.17 +++ object.hpp 19 Oct 2005 11:49:02 -0000 1.34.2.18 @@ -410,10 +410,9 @@ handle m_key; }; -#if defined(__GNUC__) || BOOST_WORKAROUND(BOOST_MSVC, == 1300) - // Needed because of GCC's and VC7's strange ADL +// Needed because of some strange ADL issues. -# define LUABIND_OPERATOR_ADL_WKND(op) \ +#define LUABIND_OPERATOR_ADL_WKND(op) \ inline bool operator op( \ basic_iterator<basic_access> const& x \ , basic_iterator<basic_access> const& y) \ @@ -431,10 +430,8 @@ LUABIND_OPERATOR_ADL_WKND(==) LUABIND_OPERATOR_ADL_WKND(!=) -# undef LUABIND_OPERATOR_ADL_WKND - -#endif - +#undef LUABIND_OPERATOR_ADL_WKND + } // namespace detail namespace adl |
From: Daniel W. <dan...@us...> - 2005-10-19 11:46:52
|
Update of /cvsroot/luabind/luabind/luabind/luabind/detail In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15867/detail Modified Files: Tag: beta7-devel2 constructor.hpp object_rep.hpp signature_match.hpp Log Message: Index: signature_match.hpp =================================================================== RCS file: /cvsroot/luabind/luabind/luabind/luabind/detail/signature_match.hpp,v retrieving revision 1.3.2.2 retrieving revision 1.3.2.3 diff -u -d -r1.3.2.2 -r1.3.2.3 --- signature_match.hpp 18 Oct 2005 17:46:56 -0000 1.3.2.2 +++ signature_match.hpp 19 Oct 2005 11:46:43 -0000 1.3.2.3 @@ -246,6 +246,10 @@ #if N int current_index = 0; #endif + // Removes unreferenced local variable warning on VC7. + (void)start_index; + (void)L; + BOOST_PP_REPEAT(N, LUABIND_MATCH_DECL, _) return m; } Index: constructor.hpp =================================================================== RCS file: /cvsroot/luabind/luabind/luabind/luabind/detail/constructor.hpp,v retrieving revision 1.7 retrieving revision 1.7.2.1 diff -u -d -r1.7 -r1.7.2.1 --- constructor.hpp 7 Aug 2004 13:37:10 -0000 1.7 +++ constructor.hpp 19 Oct 2005 11:46:43 -0000 1.7.2.1 @@ -103,8 +103,8 @@ { template<class T, class Policies, BOOST_PP_ENUM_PARAMS(LUABIND_MAX_ARITY, class A)> static T* execute( - lua_State* L - , weak_ref const& ref + lua_State* + , weak_ref const& , T* , constructor<BOOST_PP_ENUM_PARAMS(LUABIND_MAX_ARITY,A)>* , Policies*) Index: object_rep.hpp =================================================================== RCS file: /cvsroot/luabind/luabind/luabind/luabind/detail/object_rep.hpp,v retrieving revision 1.19 retrieving revision 1.19.2.1 diff -u -d -r1.19 -r1.19.2.1 --- object_rep.hpp 7 Aug 2004 13:37:10 -0000 1.19 +++ object_rep.hpp 19 Oct 2005 11:46:43 -0000 1.19.2.1 @@ -99,6 +99,8 @@ { static void apply(void* ptr) { + // Removes unreferenced formal parameter warning on VC7. + (void)ptr; #ifndef NDEBUG int completeness_check[sizeof(T)]; (void)completeness_check; |
From: Daniel W. <dan...@us...> - 2005-10-19 11:46:52
|
Update of /cvsroot/luabind/luabind/luabind/luabind In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15867 Modified Files: Tag: beta7-devel2 class.hpp Log Message: Index: class.hpp =================================================================== RCS file: /cvsroot/luabind/luabind/luabind/luabind/class.hpp,v retrieving revision 1.63.2.2 retrieving revision 1.63.2.3 diff -u -d -r1.63.2.2 -r1.63.2.3 --- class.hpp 28 Jul 2005 17:52:16 -0000 1.63.2.2 +++ class.hpp 19 Oct 2005 11:46:42 -0000 1.63.2.3 @@ -1211,7 +1211,7 @@ // these handle default implementation of virtual functions template<class F, class Policies> class_& virtual_def(char const* name, F const& fn - , Policies const& policies, detail::null_type, boost::mpl::true_) + , Policies const&, detail::null_type, boost::mpl::true_) { // normal def() call detail::overload_rep o(fn, static_cast<Policies*>(0)); @@ -1228,7 +1228,7 @@ template<class F, class Default, class Policies> class_& virtual_def(char const* name, F const& fn - , Default const& default_, Policies const& policies, boost::mpl::false_) + , Default const& default_, Policies const&, boost::mpl::false_) { // default_ is a default implementation // policies is either null_type or a policy list @@ -1255,7 +1255,7 @@ class_& def_constructor( boost::mpl::true_ /* HasWrapper */ , Signature* - , Policies const& policies) + , Policies const&) { detail::construct_rep::overload_t o; @@ -1285,7 +1285,7 @@ class_& def_constructor( boost::mpl::false_ /* !HasWrapper */ , Signature* - , Policies const& policies) + , Policies const&) { detail::construct_rep::overload_t o; |
From: Daniel W. <dan...@us...> - 2005-10-19 11:36:26
|
Update of /cvsroot/luabind/luabind/luabind/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13881 Modified Files: Tag: beta7-devel2 Jamfile Removed Files: Tag: beta7-devel2 test_resume_with_object.cpp Log Message: Removed duplicate test. Index: Jamfile =================================================================== RCS file: /cvsroot/luabind/luabind/luabind/test/Jamfile,v retrieving revision 1.15.2.4 retrieving revision 1.15.2.5 diff -u -d -r1.15.2.4 -r1.15.2.5 --- Jamfile 19 Oct 2005 10:00:35 -0000 1.15.2.4 +++ Jamfile 19 Oct 2005 11:36:15 -0000 1.15.2.5 @@ -3,7 +3,6 @@ use-project /luabind : ../ ; SOURCES = - test_resume_with_object.cpp test_def_from_base.cpp test_object.cpp test_abstract_base.cpp --- test_resume_with_object.cpp DELETED --- |
From: Daniel W. <dan...@us...> - 2005-10-19 10:01:08
|
Update of /cvsroot/luabind/luabind/luabind/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27248 Modified Files: Tag: beta7-devel2 Jamfile Added Files: Tag: beta7-devel2 test_def_from_base.cpp test_resume_with_object.cpp Log Message: Two new tests. --- NEW FILE: test_def_from_base.cpp --- // Copyright (c) 2005 Daniel Wallin, Arvid Norberg // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the "Software"), // to deal in the Software without restriction, including without limitation // the rights to use, copy, modify, merge, publish, distribute, sublicense, // and/or sell copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following conditions: // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF // ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED // TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A // PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT // SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR // ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN // ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE // OR OTHER DEALINGS IN THE SOFTWARE. #include "test.hpp" #include <luabind/luabind.hpp> struct V { int f(int,int) { return 2; } }; struct W : V {}; void test_main(lua_State* L) { using namespace luabind; module(L) [ class_<W>("W") .def(constructor<>()) .def("f", &V::f) ]; DOSTRING(L, "x = W()\n" "assert(x:f(1,2) == 2)\n" ); } Index: Jamfile =================================================================== RCS file: /cvsroot/luabind/luabind/luabind/test/Jamfile,v retrieving revision 1.15.2.3 retrieving revision 1.15.2.4 diff -u -d -r1.15.2.3 -r1.15.2.4 --- Jamfile 30 Sep 2005 09:19:29 -0000 1.15.2.3 +++ Jamfile 19 Oct 2005 10:00:35 -0000 1.15.2.4 @@ -3,6 +3,8 @@ use-project /luabind : ../ ; SOURCES = + test_resume_with_object.cpp + test_def_from_base.cpp test_object.cpp test_abstract_base.cpp test_attributes.cpp @@ -38,5 +40,7 @@ tests += [ run $(src) main-lib ] ; } -test-suite luabind-test : $(tests) [ compile test_typetraits.cpp ] ; +test-suite luabind-test : $(tests) + [ compile test_typetraits.cpp ] + ; --- NEW FILE: test_resume_with_object.cpp --- // Copyright (c) 2005 Daniel Wallin, Arvid Norberg // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the "Software"), // to deal in the Software without restriction, including without limitation // the rights to use, copy, modify, merge, publish, distribute, sublicense, // and/or sell copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following conditions: // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF // ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED // TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A // PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT // SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR // ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN // ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE // OR OTHER DEALINGS IN THE SOFTWARE. #include "test.hpp" #include <luabind/luabind.hpp> #include <luabind/object.hpp> // // Demonstrates bug reported in: // http://article.gmane.org/gmane.comp.lang.lua.bind.user/864/match=bug+resume+function // void f(char const*) {} void test_main(lua_State* L) { using namespace luabind; module(L) [ def("f", &f) ]; DOSTRING(L, "function g()\n" " f('xxx')\n" " f(15)\n" "end\n" ); object g = globals(L)["g"]; resume_function<void>(g); } |
From: Daniel W. <dan...@us...> - 2005-10-18 17:47:09
|
Update of /cvsroot/luabind/luabind/luabind/luabind/detail In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11818/detail Modified Files: Tag: beta7-devel2 call.hpp signature_match.hpp Added Files: Tag: beta7-devel2 most_derived.hpp Log Message: Fixed problem with missing most_derived<> in signature_match.hpp. Index: signature_match.hpp =================================================================== RCS file: /cvsroot/luabind/luabind/luabind/luabind/detail/signature_match.hpp,v retrieving revision 1.3.2.1 retrieving revision 1.3.2.2 diff -u -d -r1.3.2.1 -r1.3.2.2 --- signature_match.hpp 27 Jul 2005 21:25:40 -0000 1.3.2.1 +++ signature_match.hpp 18 Oct 2005 17:46:56 -0000 1.3.2.2 @@ -48,6 +48,7 @@ #include <luabind/detail/primitives.hpp> #include <luabind/detail/object_rep.hpp> #include <luabind/detail/class_rep.hpp> +#include <luabind/detail/most_derived.hpp> namespace luabind { @@ -189,7 +190,7 @@ , Policies const*) { typedef constructor< - T& + typename most_derived<T,WrappedClass>::type& BOOST_PP_ENUM_TRAILING_PARAMS(N, A) > params_t; @@ -213,7 +214,7 @@ , Policies const* policies) { typedef constructor< - T const& + typename most_derived<T,WrappedClass>::type const& BOOST_PP_ENUM_TRAILING_PARAMS(N, A) > params_t; return match_params( Index: call.hpp =================================================================== RCS file: /cvsroot/luabind/luabind/luabind/luabind/detail/call.hpp,v retrieving revision 1.6 retrieving revision 1.6.2.1 diff -u -d -r1.6 -r1.6.2.1 --- call.hpp 7 Aug 2004 13:37:10 -0000 1.6 +++ call.hpp 18 Oct 2005 17:46:56 -0000 1.6.2.1 @@ -41,6 +41,8 @@ #include <luabind/detail/policy.hpp> #include <luabind/yield_policy.hpp> +#include <luabind/detail/most_derived.hpp> + #define LUABIND_DECL(z, n, off) \ typedef typename find_conversion_policy< \ n + off \ @@ -92,16 +94,6 @@ } }; - template<class Class, class WrappedClass> - struct most_derived - { - typedef typename boost::mpl::if_< - boost::is_base_and_derived<Class, WrappedClass> - , WrappedClass - , Class - >::type type; - }; - template<class T> struct returns { --- NEW FILE: most_derived.hpp --- // Copyright (c) 2005 Daniel Wallin and Arvid Norberg // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the "Software"), // to deal in the Software without restriction, including without limitation // the rights to use, copy, modify, merge, publish, distribute, sublicense, // and/or sell copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following conditions: // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF // ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED // TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A // PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT // SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR // ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN // ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE // OR OTHER DEALINGS IN THE SOFTWARE. #ifndef MOST_DERIVED_051018_HPP # define MOST_DERIVED_051018_HPP # include <boost/mpl/if.hpp> # include <boost/type_traits/is_base_and_derived.hpp> namespace luabind { namespace detail { template<class Class, class WrappedClass> struct most_derived { typedef typename boost::mpl::if_< boost::is_base_and_derived<Class, WrappedClass> , WrappedClass , Class >::type type; }; }} // namespace luabind::detail #endif // MOST_DERIVED_051018_HPP |
From: Arvid N. <ar...@us...> - 2005-10-18 16:03:42
|
Update of /cvsroot/luabind/luabind/luabind/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17908/test Modified Files: Tag: beta7-devel2 test_lua_classes.cpp Log Message: added a test to lua_test_classes that fails. Index: test_lua_classes.cpp =================================================================== RCS file: /cvsroot/luabind/luabind/luabind/test/test_lua_classes.cpp,v retrieving revision 1.26.2.2 retrieving revision 1.26.2.3 diff -u -d -r1.26.2.2 -r1.26.2.3 --- test_lua_classes.cpp 29 Jul 2005 02:41:02 -0000 1.26.2.2 +++ test_lua_classes.cpp 18 Oct 2005 16:03:25 -0000 1.26.2.3 @@ -136,6 +136,15 @@ int f(int, int) { return 2; } }; +struct V +{ + int f(int,int) { return 2; } +}; + +struct W : V +{ +}; + void test_main(lua_State* L) { module(L) @@ -163,7 +172,11 @@ class_<U, T_>("U") .def(constructor<>()) .def("f", &U::f) - .def("g", &U::g) + .def("g", &U::g), + + class_<W>("W") + .def(constructor<>()) + .def("f", &V::f) ]; try @@ -183,6 +196,10 @@ } DOSTRING(L, + "w = W()\n" + "assert(w:f(1,1) == 2)"); + + DOSTRING(L, "u = U()\n" "assert(u:f(0) == 1)\n" "assert(u:f(0,0) == 2)\n" |
From: Arvid N. <ar...@us...> - 2005-10-10 09:51:21
|
Update of /cvsroot/luabind/luabind/luabind/luabind/detail In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32268/luabind/detail Modified Files: Tag: beta7-devel2 class_rep.hpp overload_rep.hpp Log Message: Index: overload_rep.hpp =================================================================== RCS file: /cvsroot/luabind/luabind/luabind/luabind/detail/overload_rep.hpp,v retrieving revision 1.6.2.2 retrieving revision 1.6.2.3 diff -u -d -r1.6.2.2 -r1.6.2.3 --- overload_rep.hpp 1 Aug 2005 17:24:32 -0000 1.6.2.2 +++ overload_rep.hpp 10 Oct 2005 09:51:18 -0000 1.6.2.3 @@ -32,12 +32,15 @@ #include <boost/preprocessor/iteration/iterate.hpp> #include <boost/preprocessor/repetition/enum_trailing_params.hpp> #include <boost/preprocessor/repeat.hpp> +#include <vector> #include <luabind/detail/overload_rep_base.hpp> -#include <luabind/detail/class_rep.hpp> #include <luabind/detail/is_indirect_const.hpp> + +#ifndef BOOST_MSVC #include <luabind/detail/policy.hpp> +#endif namespace luabind { namespace detail { Index: class_rep.hpp =================================================================== RCS file: /cvsroot/luabind/luabind/luabind/luabind/detail/class_rep.hpp,v retrieving revision 1.41.2.5 retrieving revision 1.41.2.6 diff -u -d -r1.41.2.5 -r1.41.2.6 --- class_rep.hpp 10 Oct 2005 09:07:07 -0000 1.41.2.5 +++ class_rep.hpp 10 Oct 2005 09:51:18 -0000 1.41.2.6 @@ -41,7 +41,15 @@ #include <luabind/error.hpp> #include <luabind/handle.hpp> #include <luabind/detail/primitives.hpp> + +#ifdef BOOST_MSVC +// msvc doesn't have two-phase, but requires +// method_rep (and overload_rep) to be complete +// because of its std::list implementation. +// gcc on the other hand has two-phase but doesn't +// require method_rep to be complete. #include <luabind/detail/method_rep.hpp> +#endif namespace luabind { |
From: Arvid N. <ar...@us...> - 2005-10-10 09:07:09
|
Update of /cvsroot/luabind/luabind/luabind/luabind/detail In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22940/detail Modified Files: Tag: beta7-devel2 class_rep.hpp Log Message: Index: class_rep.hpp =================================================================== RCS file: /cvsroot/luabind/luabind/luabind/luabind/detail/class_rep.hpp,v retrieving revision 1.41.2.4 retrieving revision 1.41.2.5 diff -u -d -r1.41.2.4 -r1.41.2.5 --- class_rep.hpp 10 Oct 2005 00:39:50 -0000 1.41.2.4 +++ class_rep.hpp 10 Oct 2005 09:07:07 -0000 1.41.2.5 @@ -41,6 +41,7 @@ #include <luabind/error.hpp> #include <luabind/handle.hpp> #include <luabind/detail/primitives.hpp> +#include <luabind/detail/method_rep.hpp> namespace luabind { |
From: Daniel W. <dan...@us...> - 2005-10-10 08:55:10
|
Update of /cvsroot/luabind/luabind/luabind/luabind/detail In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20008/luabind/detail Modified Files: Tag: daniel-refactoring class_rep.hpp Log Message: merged_beta7-devel2_into_daniel-refactoring_051010 Index: class_rep.hpp =================================================================== RCS file: /cvsroot/luabind/luabind/luabind/luabind/detail/class_rep.hpp,v retrieving revision 1.41.2.3.2.1 retrieving revision 1.41.2.3.2.2 diff -u -d -r1.41.2.3.2.1 -r1.41.2.3.2.2 --- class_rep.hpp 2 Oct 2005 00:19:11 -0000 1.41.2.3.2.1 +++ class_rep.hpp 10 Oct 2005 08:55:05 -0000 1.41.2.3.2.2 @@ -35,12 +35,10 @@ #include <luabind/detail/construct_rep.hpp> #include <luabind/detail/garbage_collector.hpp> #include <luabind/detail/operator_id.hpp> -//#include <luabind/detail/signature_match.hpp> #include <luabind/detail/class_registry.hpp> #include <luabind/detail/find_best_match.hpp> #include <luabind/detail/get_overload_signature.hpp> #include <luabind/error.hpp> -//#include <luabind/detail/method_rep.hpp> #include <luabind/handle.hpp> #include <luabind/detail/primitives.hpp> |
From: Daniel W. <dan...@us...> - 2005-10-10 08:55:10
|
Update of /cvsroot/luabind/luabind/luabind/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20008/test Modified Files: Tag: daniel-refactoring test_value_wrapper.cpp Log Message: merged_beta7-devel2_into_daniel-refactoring_051010 Index: test_value_wrapper.cpp =================================================================== RCS file: /cvsroot/luabind/luabind/luabind/test/Attic/test_value_wrapper.cpp,v retrieving revision 1.1.2.1 retrieving revision 1.1.2.1.2.1 diff -u -d -r1.1.2.1 -r1.1.2.1.2.1 --- test_value_wrapper.cpp 30 Sep 2005 09:19:29 -0000 1.1.2.1 +++ test_value_wrapper.cpp 10 Oct 2005 08:55:05 -0000 1.1.2.1.2.1 @@ -39,6 +39,14 @@ typedef boost::mpl::true_ is_specialized; }; + // used on compilers supporting partial template specialization + template<> + struct value_wrapper_traits<X> + { + typedef boost::mpl::true_ is_specialized; + }; + + } // namespace luabind BOOST_MPL_ASSERT(( luabind::is_value_wrapper<X> )); @@ -55,3 +63,4 @@ int main() { } + |
From: Arvid N. <ar...@us...> - 2005-10-10 00:40:02
|
Update of /cvsroot/luabind/luabind/luabind/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31573/test Modified Files: Tag: beta7-devel2 test_value_wrapper.cpp Log Message: removed unused include in class_rep.hpp and fixed value_wrapper_test for compilers not using the tags for value wrappers Index: test_value_wrapper.cpp =================================================================== RCS file: /cvsroot/luabind/luabind/luabind/test/Attic/test_value_wrapper.cpp,v retrieving revision 1.1.2.1 retrieving revision 1.1.2.2 diff -u -d -r1.1.2.1 -r1.1.2.2 --- test_value_wrapper.cpp 30 Sep 2005 09:19:29 -0000 1.1.2.1 +++ test_value_wrapper.cpp 10 Oct 2005 00:39:51 -0000 1.1.2.2 @@ -39,6 +39,14 @@ typedef boost::mpl::true_ is_specialized; }; + // used on compilers supporting partial template specialization + template<> + struct value_wrapper_traits<X> + { + typedef boost::mpl::true_ is_specialized; + }; + + } // namespace luabind BOOST_MPL_ASSERT(( luabind::is_value_wrapper<X> )); @@ -55,3 +63,4 @@ int main() { } + |
From: Arvid N. <ar...@us...> - 2005-10-10 00:40:02
|
Update of /cvsroot/luabind/luabind/luabind/luabind/detail In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31573/luabind/detail Modified Files: Tag: beta7-devel2 class_rep.hpp Log Message: removed unused include in class_rep.hpp and fixed value_wrapper_test for compilers not using the tags for value wrappers Index: class_rep.hpp =================================================================== RCS file: /cvsroot/luabind/luabind/luabind/luabind/detail/class_rep.hpp,v retrieving revision 1.41.2.3 retrieving revision 1.41.2.4 diff -u -d -r1.41.2.3 -r1.41.2.4 --- class_rep.hpp 29 Sep 2005 14:58:31 -0000 1.41.2.3 +++ class_rep.hpp 10 Oct 2005 00:39:50 -0000 1.41.2.4 @@ -35,12 +35,10 @@ #include <luabind/detail/construct_rep.hpp> #include <luabind/detail/garbage_collector.hpp> #include <luabind/detail/operator_id.hpp> -//#include <luabind/detail/signature_match.hpp> #include <luabind/detail/class_registry.hpp> #include <luabind/detail/find_best_match.hpp> #include <luabind/detail/get_overload_signature.hpp> #include <luabind/error.hpp> -#include <luabind/detail/method_rep.hpp> #include <luabind/handle.hpp> #include <luabind/detail/primitives.hpp> |
From: Daniel W. <dan...@us...> - 2005-10-02 21:53:37
|
Update of /cvsroot/luabind/luabind/luabind/luabind In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25461 Modified Files: Tag: daniel-refactoring class.hpp Added Files: Tag: daniel-refactoring class_fwd.hpp Log Message: Moved parameter deduction metacode to a separate file detail/class_aux.hpp. --- NEW FILE: class_fwd.hpp --- // Copyright (c) 2005 Daniel Wallin and Arvid Norberg // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the "Software"), // to deal in the Software without restriction, including without limitation // the rights to use, copy, modify, merge, publish, distribute, sublicense, // and/or sell copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following conditions: // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF // ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED // TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A // PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT // SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR // ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN // ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE // OR OTHER DEALINGS IN THE SOFTWARE. #ifndef LUABIND_CLASS_FWD_051002_HPP #define LUABIND_CLASS_FWD_051002_HPP #include <luabind/detail/unspecified.hpp> namespace luabind { template< class T , class X1 = detail::unspecified , class X2 = detail::unspecified , class X3 = detail::unspecified > struct class_; } // namespace luabind #endif // LUABIND_CLASS_FWD_051002_HPP Index: class.hpp =================================================================== RCS file: /cvsroot/luabind/luabind/luabind/luabind/class.hpp,v retrieving revision 1.63.2.2 retrieving revision 1.63.2.2.2.1 diff -u -d -r1.63.2.2 -r1.63.2.2.2.1 --- class.hpp 28 Jul 2005 17:52:16 -0000 1.63.2.2 +++ class.hpp 2 Oct 2005 00:19:11 -0000 1.63.2.2.2.1 @@ -76,20 +76,12 @@ #include <cassert> #include <boost/static_assert.hpp> -#include <boost/type_traits.hpp> #include <boost/bind.hpp> #include <boost/function.hpp> #include <boost/preprocessor/repetition/enum_params.hpp> -#include <boost/preprocessor/repetition/enum_params_with_a_default.hpp> #include <boost/preprocessor/repetition/repeat.hpp> #include <boost/type_traits/is_same.hpp> -#include <boost/mpl/list.hpp> -#include <boost/mpl/apply.hpp> -#include <boost/mpl/lambda.hpp> -#include <boost/mpl/logical.hpp> -#include <boost/mpl/find_if.hpp> #include <boost/mpl/eval_if.hpp> -#include <boost/mpl/logical.hpp> #include <luabind/config.hpp> #include <luabind/scope.hpp> @@ -114,6 +106,10 @@ #include <luabind/detail/pointee_typeid.hpp> #include <luabind/detail/link_compatibility.hpp> +#include <luabind/class_fwd.hpp> +#include <luabind/detail/class_aux.hpp> +#include <luabind/detail/unspecified.hpp> + // to remove the 'this' used in initialization list-warning #ifdef _MSC_VER #pragma warning(push) @@ -125,16 +121,11 @@ { namespace detail { - struct unspecified {}; - template<class Derived> struct operator_; struct you_need_to_define_a_get_const_holder_function_for_your_smart_ptr {}; } - template<class T, class X1 = detail::unspecified, class X2 = detail::unspecified, class X3 = detail::unspecified> - struct class_; - // TODO: this function will only be invoked if the user hasn't defined a correct overload // maybe we should have a static assert in here? inline detail::you_need_to_define_a_get_const_holder_function_for_your_smart_ptr* @@ -145,61 +136,6 @@ namespace detail { - template<BOOST_PP_ENUM_PARAMS(LUABIND_MAX_BASES, class A)> - double is_bases_helper(const bases<BOOST_PP_ENUM_PARAMS(LUABIND_MAX_BASES, A)>&); - -#ifndef BOOST_MSVC - template<class T> - char is_bases_helper(const T&); -#else - char is_bases_helper(...); -#endif - - template<class T> - struct is_bases - { - static const T& t; - - BOOST_STATIC_CONSTANT(bool, value = sizeof(is_bases_helper(t)) == sizeof(double)); - typedef boost::mpl::bool_<value> type; - BOOST_MPL_AUX_LAMBDA_SUPPORT(1,is_bases,(T)) - }; - - double is_not_unspecified_helper(const unspecified*); - char is_not_unspecified_helper(...); - - template<class T> - struct is_not_unspecified - { - BOOST_STATIC_CONSTANT(bool, value = sizeof(is_not_unspecified_helper(static_cast<T*>(0))) == sizeof(char)); - typedef boost::mpl::bool_<value> type; - BOOST_MPL_AUX_LAMBDA_SUPPORT(1,is_not_unspecified,(T)) - }; - - template<class Predicate> - struct get_predicate - { - typedef typename boost::mpl::and_< - is_not_unspecified<boost::mpl::_1> - , Predicate - > type; - }; - - template<class Parameters, class Predicate, class DefaultValue> - struct extract_parameter - { - typedef typename get_predicate<Predicate>::type pred; - typedef typename boost::mpl::find_if<Parameters, pred>::type iterator; - typedef typename boost::mpl::eval_if< - boost::is_same< - iterator - , typename boost::mpl::end<Parameters>::type - > - , boost::mpl::identity<DefaultValue> - , boost::mpl::deref<iterator> - >::type type; - }; - template<class Fn, class Class, class Policies> struct mem_fn_callback { @@ -786,38 +722,16 @@ // registers a class in the lua environment template<class T, class X1, class X2, class X3> - struct class_: detail::class_base + struct class_ : detail::class_base { typedef class_<T, X1, X2, X3> self_t; + typedef detail::class_aux<T,X1,X2,X3> meta; private: - template<class A, class B, class C, class D> class_(const class_<A,B,C,D>&); public: - - // WrappedType MUST inherit from T - typedef typename detail::extract_parameter< - boost::mpl::vector3<X1,X2,X3> - , boost::is_base_and_derived<T, boost::mpl::_> - , detail::null_type - >::type WrappedType; - - typedef typename detail::extract_parameter< - boost::mpl::list3<X1,X2,X3> - , boost::mpl::not_< - boost::mpl::or_< - boost::mpl::or_< - detail::is_bases<boost::mpl::_> - , boost::is_base_and_derived<boost::mpl::_, T> - > - , boost::is_base_and_derived<T, boost::mpl::_> - > - > - , detail::null_type - >::type HeldType; - // this function generates conversion information // in the given class_rep structure. It will be able // to implicitly cast to the given template type @@ -890,7 +804,7 @@ class_& def(constructor<BOOST_PP_ENUM_PARAMS(LUABIND_MAX_ARITY, A)> sig) { return this->def_constructor( - boost::is_same<WrappedType, detail::null_type>() + boost::is_same<typename meta::wrapped_type, detail::null_type>() , &sig , detail::null_type() ); @@ -900,7 +814,7 @@ class_& def(constructor<BOOST_PP_ENUM_PARAMS(LUABIND_MAX_ARITY, A)> sig, const Policies& policies) { return this->def_constructor( - boost::is_same<WrappedType, detail::null_type>() + boost::is_same<typename meta::wrapped_type, detail::null_type>() , &sig , policies ); @@ -1142,41 +1056,26 @@ void init() { set_back_reference((back_reference<T>*)0); - - typedef typename detail::extract_parameter< - boost::mpl::list3<X1,X2,X3> - , boost::mpl::or_< - detail::is_bases<boost::mpl::_> - , boost::is_base_and_derived<boost::mpl::_, T> - > - , no_bases - >::type bases_t; - - typedef typename - boost::mpl::if_<detail::is_bases<bases_t> - , bases_t - , bases<bases_t> - >::type Base; class_base::init(LUABIND_TYPEID(T) - , detail::internal_holder_type<HeldType>::apply() + , detail::internal_holder_type<typename meta::held_type>::apply() , detail::pointee_typeid( - get_const_holder(static_cast<HeldType*>(0))) - , detail::internal_holder_extractor<HeldType>::apply(detail::type_<T>()) - , detail::internal_const_holder_extractor<HeldType>::apply(detail::type_<T>()) - , detail::const_converter<HeldType>::apply( - get_const_holder((HeldType*)0)) - , detail::holder_constructor<HeldType>::apply(detail::type_<T>()) - , detail::const_holder_constructor<HeldType>::apply(detail::type_<T>()) - , detail::holder_default_constructor<HeldType>::apply(detail::type_<T>()) - , detail::const_holder_default_constructor<HeldType>::apply(detail::type_<T>()) - , get_adopt_fun((WrappedType*)0) // adopt fun - , detail::internal_holder_destructor<HeldType>::apply(detail::type_<T>()) - , detail::internal_const_holder_destructor<HeldType>::apply(detail::type_<T>()) - , detail::internal_holder_size<HeldType>::apply() - , detail::get_holder_alignment<HeldType>::apply()); + get_const_holder(static_cast<typename meta::held_type*>(0))) + , detail::internal_holder_extractor<typename meta::held_type>::apply(detail::type_<T>()) + , detail::internal_const_holder_extractor<typename meta::held_type>::apply(detail::type_<T>()) + , detail::const_converter<typename meta::held_type>::apply( + get_const_holder((typename meta::held_type*)0)) + , detail::holder_constructor<typename meta::held_type>::apply(detail::type_<T>()) + , detail::const_holder_constructor<typename meta::held_type>::apply(detail::type_<T>()) + , detail::holder_default_constructor<typename meta::held_type>::apply(detail::type_<T>()) + , detail::const_holder_default_constructor<typename meta::held_type>::apply(detail::type_<T>()) + , get_adopt_fun((typename meta::wrapped_type*)0) // adopt fun + , detail::internal_holder_destructor<typename meta::held_type>::apply(detail::type_<T>()) + , detail::internal_const_holder_destructor<typename meta::held_type>::apply(detail::type_<T>()) + , detail::internal_holder_size<typename meta::held_type>::apply() + , detail::get_holder_alignment<typename meta::held_type>::apply()); - generate_baseclass_list(detail::type_<Base>()); + generate_baseclass_list(detail::type_<typename meta::bases_type>()); } template<class Getter, class GetPolicies> @@ -1292,7 +1191,7 @@ o.set_constructor( &detail::construct_wrapped_class< T - , WrappedType + , typename meta::wrapped_type , Policies , Signature >::apply); @@ -1315,7 +1214,7 @@ void set_back_reference(detail::default_back_reference*) { back_reference<T>::has_wrapper - = !boost::is_same<WrappedType, detail::null_type>::value; + = !boost::is_same<typename meta::wrapped_type, detail::null_type>::value; } void set_back_reference(void*) |