summaryrefslogtreecommitdiffstats
path: root/src/luabind-6-iterator-equality.patch
blob: 843276b05981e560fd76ad3ab6279d60d79c9629 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
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