From c7e9fd61a8b928ca570b73fa6fa23cd68fefc61e Mon Sep 17 00:00:00 2001
From: Boris Nagaev <bnagaev@gmail.com>
Date: Fri, 5 Dec 2014 14:36:52 +0300
Subject: [PATCH] fix luabind::detail::basic_iterator == and !=

MinGW-w64, boost 1.57
---
 luabind/object.hpp |   44 +++++++++++++++++++++++++++-----------------
 1 file changed, 27 insertions(+), 17 deletions(-)

diff --git a/luabind/object.hpp b/luabind/object.hpp
index b288171..4ba0519 100644
--- a/luabind/object.hpp
+++ b/luabind/object.hpp
@@ -512,6 +512,7 @@ namespace detail
           }
       }
 
+  public:
       bool equal(basic_iterator const& other) const
       {
           if (m_interpreter == 0 && other.m_interpreter == 0)
@@ -526,6 +527,7 @@ namespace detail
           return lua_equal(m_interpreter, -2, -1) != 0;
       }
 
+  private:
       adl::iterator_proxy<AccessPolicy> dereference() const 
       {
           return adl::iterator_proxy<AccessPolicy>(m_interpreter, m_table, m_key);
@@ -538,26 +540,34 @@ namespace detail
 
 // Needed because of some strange ADL issues.
 
-#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); \
+  inline bool operator ==(
+      basic_iterator<basic_access> const& x
+    , basic_iterator<basic_access> const& y)
+  {
+      return x.equal(y);
+  }
+
+  inline bool operator ==(
+      basic_iterator<raw_access> const& x
+    , basic_iterator<raw_access> const& y)
+  {
+      return x.equal(y);
   }
 
-  LUABIND_OPERATOR_ADL_WKND(==)
-  LUABIND_OPERATOR_ADL_WKND(!=)
+  inline bool operator !=(
+      basic_iterator<basic_access> const& x
+    , basic_iterator<basic_access> const& y)
+  {
+      return !(x.equal(y));
+  }
+
+  inline bool operator !=(
+      basic_iterator<raw_access> const& x
+    , basic_iterator<raw_access> const& y)
+  {
+      return !(x.equal(y));
+  }
 
-#undef LUABIND_OPERATOR_ADL_WKND
- 
 } // namespace detail
 
 namespace adl
-- 
1.7.10.4

