Skip to content

Commit 1e258cf

Browse files
author
Kjell Ahlstedt
committed
slot_rep: Rename dup() to clone()
because clone() is the usual name of such a function. Bug 777618
1 parent a460965 commit 1e258cf

File tree

3 files changed

+10
-10
lines changed

3 files changed

+10
-10
lines changed

sigc++/functors/slot.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ struct typed_slot_rep : public slot_rep
102102
* slot_rep object is registered in the referred trackables.
103103
* @return A deep copy of the slot_rep object.
104104
*/
105-
slot_rep* dup() const override { return new typed_slot_rep(*this); }
105+
slot_rep* clone() const override { return new typed_slot_rep(*this); }
106106
};
107107

108108
/** Abstracts functor execution.

sigc++/functors/slot_base.cc

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -94,10 +94,10 @@ slot_base::slot_base(const slot_base& src) : rep_(nullptr), blocked_(src.blocked
9494
{
9595
// Check call_ so we can ignore invalidated slots.
9696
// Otherwise, destroyed bound reference parameters (whose destruction caused the slot's
97-
// invalidation) may be used during dup().
98-
// Note: I'd prefer to check somewhere during dup(). murrayc.
97+
// invalidation) may be used during clone().
98+
// Note: I'd prefer to check somewhere during clone(). murrayc.
9999
if (src.rep_->call_)
100-
rep_ = src.rep_->dup();
100+
rep_ = src.rep_->clone();
101101
else
102102
{
103103
*this = slot_base(); // Return the default invalid slot.
@@ -116,9 +116,9 @@ slot_base::slot_base(slot_base&& src) : rep_(nullptr), blocked_(src.blocked_)
116116

117117
// Check call_ so we can ignore invalidated slots.
118118
// Otherwise, destroyed bound reference parameters (whose destruction
119-
// caused the slot's invalidation) may be used during dup().
119+
// caused the slot's invalidation) may be used during clone().
120120
if (src.rep_->call_)
121-
rep_ = src.rep_->dup();
121+
rep_ = src.rep_->clone();
122122
else
123123
blocked_ = false; // Return the default invalid slot.
124124
}
@@ -184,7 +184,7 @@ slot_base::operator=(const slot_base& src)
184184
return *this;
185185
}
186186

187-
auto new_rep_ = src.rep_->dup();
187+
auto new_rep_ = src.rep_->clone();
188188

189189
if (rep_) // Silently exchange the slot_rep.
190190
{
@@ -219,7 +219,7 @@ slot_base::operator=(slot_base&& src)
219219
{
220220
// src is connected to a parent, e.g. a sigc::signal.
221221
// Copy, don't move! See https://bugzilla.gnome.org/show_bug.cgi?id=756484
222-
new_rep_ = src.rep_->dup();
222+
new_rep_ = src.rep_->clone();
223223
}
224224
else
225225
{

sigc++/functors/slot_base.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ using hook = void* (*)(void*);
4040
*
4141
* The base class slot_rep serves the purpose to
4242
* - form a common pointer type (slot_rep*),
43-
* - offer the possibility to create duplicates (dup()),
43+
* - offer the possibility to create duplicates (clone()),
4444
* - offer a notification callback (notify()),
4545
* - implement some of slot_base's interface that depends
4646
* on the notification callback, i.e.
@@ -88,7 +88,7 @@ struct SIGC_API slot_rep : public trackable
8888
/** Makes a deep copy of the slot_rep object.
8989
* @return A deep copy of the slot_rep object.
9090
*/
91-
virtual slot_rep* dup() const = 0;
91+
virtual slot_rep* clone() const = 0;
9292

9393
/** Set the parent with a callback.
9494
* slots have one parent exclusively.

0 commit comments

Comments
 (0)