@@ -51,13 +51,21 @@ template < typename B> class stacked_vector {
51
51
operator const B&() const {
52
52
return m_vec.m_vector [m_i];
53
53
}
54
-
54
+
55
55
bool operator ==(B const & other) const {
56
56
return m_vec.m_vector [m_i] == other;
57
57
}
58
58
bool operator !=(B const & other) const {
59
59
return m_vec.m_vector [m_i] != other;
60
60
}
61
+ bool operator ==(ref const & other) const {
62
+ return m_vec.m_vector [m_i] == other.m_vec .m_vector [other.m_i ];
63
+ }
64
+ bool operator !=(ref const & other) const {
65
+ return m_vec.m_vector [m_i] != other.m_vec .m_vectpr [other.m_i ];
66
+ }
67
+
68
+
61
69
B& operator +=(B const &delta) {
62
70
// not tracking the change here!
63
71
return m_vec.m_vector [m_i] += delta;
@@ -74,12 +82,16 @@ template < typename B> class stacked_vector {
74
82
public:
75
83
ref_const (const stacked_vector<B> &m, unsigned key) :m_vec(m), m_i(key) {
76
84
lp_assert (key < m.size ());
77
- }
78
-
85
+ }
79
86
operator const B&() const {
80
87
return m_vec.m_vector [m_i];
81
88
}
82
-
89
+ bool operator ==(ref_const const & other) const {
90
+ return m_vec.m_vector [m_i] == other.m_vec .m_vector [other.m_i ];
91
+ }
92
+ bool operator !=(ref_const const & other) const {
93
+ return m_vec.m_vector [m_i] != other.m_vec .m_vectpr [other.m_i ];
94
+ }
83
95
};
84
96
85
97
private:
0 commit comments