Update of /cvsroot/luabind/luabind/luabind/luabind
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21211
Modified Files:
Tag: beta7-devel2
object.hpp
Log Message:
Operator fix for GCC and VC7.0. ETI fix in is_value_wrapper.
Index: object.hpp
===================================================================
RCS file: /cvsroot/luabind/luabind/luabind/luabind/object.hpp,v
retrieving revision 1.34.2.15
retrieving revision 1.34.2.16
diff -u -d -r1.34.2.15 -r1.34.2.16
--- object.hpp 29 Sep 2005 23:35:24 -0000 1.34.2.15
+++ object.hpp 30 Sep 2005 11:19:53 -0000 1.34.2.16
@@ -110,13 +110,13 @@
return binary_interpreter(
x
, y
- , BOOST_DEDUCED_TYPENAME value_wrapper_traits<T>::is_specialized()
- , BOOST_DEDUCED_TYPENAME value_wrapper_traits<U>::is_specialized()
+ , is_value_wrapper<T>()
+ , is_value_wrapper<U>()
);
}
#define LUABIND_BINARY_OP_DEF(op, fn) \
- template <class LHS, class RHS> \
+ template<class LHS, class RHS> \
bool operator op(LHS const& lhs, RHS const& rhs) \
{ \
lua_State* L = binary_interpreter(lhs, rhs); \
@@ -135,7 +135,31 @@
LUABIND_BINARY_OP_DEF(<, lua_lessthan)
#undef LUABIND_BINARY_OP_DEF
-
+
+ template<class LHS, class RHS>
+ bool operator>(LHS const& lhs, RHS const& rhs)
+ {
+ return !(lhs < rhs || lhs == rhs);
+ }
+
+ template<class LHS, class RHS>
+ bool operator<=(LHS const& lhs, RHS const& rhs)
+ {
+ return lhs < rhs || lhs == rhs;
+ }
+
+ template<class LHS, class RHS>
+ bool operator>=(LHS const& lhs, RHS const& rhs)
+ {
+ return !(lhs < rhs);
+ }
+
+ template<class LHS, class RHS>
+ bool operator!=(LHS const& lhs, RHS const& rhs)
+ {
+ return !(lhs < rhs);
+ }
+
template<class ValueWrapper, class Arguments>
struct call_proxy;
@@ -389,22 +413,29 @@
handle m_key;
};
-// TODO this should test for VC7<..
-#ifdef __GNUC__
+#if defined(__GNUC__) || BOOST_WORKAROUND(BOOST_MSVC, == 1300)
// Needed because of GCC's and VC7's strange ADL
- inline bool operator==(
- basic_iterator<basic_access> const& x
- , basic_iterator<basic_access> const& y)
- {
- return boost::operator==(x, y);
- }
- inline bool operator==(
- basic_iterator<raw_access> const& x
- , basic_iterator<raw_access> const& y)
- {
- return boost::operator==(x, y);
+# define LUABIND_OPERATOR_ADL_WKND(op) \
+ inline bool operator op( \
+ basic_iterator<basic_access> const& x \
+ , basic_iterator<basic_access> const& y) \
+ { \
+ return boost::operator op(x, y); \
+ } \
+ \
+ inline bool operator op( \
+ basic_iterator<raw_access> const& x \
+ , basic_iterator<raw_access> const& y) \
+ { \
+ return boost::operator op(x, y); \
}
+
+ LUABIND_OPERATOR_ADL_WKND(==)
+ LUABIND_OPERATOR_ADL_WKND(!=)
+
+# undef LUABIND_OPERATOR_ADL_WKND
+
#endif
} // namespace detail
|