Skip to content

Commit 1c10332

Browse files
committed
Delete instead of hide copy constructor/assigment operator
1 parent bbf1b1f commit 1c10332

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

src/common/classes/condition.h

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -77,10 +77,6 @@ class Condition
7777
}
7878
}
7979

80-
// Forbid copying
81-
Condition(const Condition&);
82-
Condition& operator=(const Condition&);
83-
8480
public:
8581
Condition() { init(); }
8682
explicit Condition(MemoryPool&) { init(); }
@@ -93,6 +89,10 @@ class Condition
9389
system_call_failed::raise("CloseHandle(BROADCAST)");
9490
}
9591

92+
// Forbid copying
93+
Condition(const Condition&) = delete;
94+
Condition& operator=(const Condition&) = delete;
95+
9696
void wait(Mutex& m)
9797
{
9898
++waiters;
@@ -155,10 +155,6 @@ class Condition
155155
}
156156
}
157157

158-
// Forbid copying
159-
Condition(const Condition&);
160-
Condition& operator=(const Condition&);
161-
162158
public:
163159
Condition() { init(); }
164160
explicit Condition(MemoryPool&) { init(); }
@@ -173,6 +169,10 @@ class Condition
173169
}
174170
}
175171

172+
// Forbid copying
173+
Condition(const Condition&) = delete;
174+
Condition& operator=(const Condition&) = delete;
175+
176176
void notifyOne()
177177
{
178178
int err = pthread_cond_signal(&cv);

0 commit comments

Comments
 (0)