Skip to content

Commit 735c7b7

Browse files
committed
guardt::operator-=: use member function instead of friend
1 parent be859fb commit 735c7b7

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

src/util/guard.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ void guardt::add(const exprt &expr)
127127

128128
/*******************************************************************\
129129
130-
Function: operator -=
130+
Function: guardt::operator -=
131131
132132
Inputs:
133133
@@ -137,8 +137,10 @@ Function: operator -=
137137
138138
\*******************************************************************/
139139

140-
guardt &operator -= (guardt &g1, const guardt &g2)
140+
guardt& guardt::operator -= (const guardt &g2)
141141
{
142+
guardt &g1=*this;
143+
142144
if(g1.id()!=ID_and || g2.id()!=ID_and)
143145
return g1;
144146

src/util/guard.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ class guardt:public exprt
5959
void make_false();
6060
#endif
6161

62-
friend guardt &operator -= (guardt &g1, const guardt &g2);
62+
guardt& operator -= (const guardt &g2);
6363
guardt& logical_or(const guardt &g2, const namespacet &ns);
6464

6565
#if 0

0 commit comments

Comments
 (0)