Skip to content

Commit 3f71899

Browse files
committed
Connection: Constructor: Take slot_base as reference.
This constructor existed before, so this avoids an API break.
1 parent 78f9b5c commit 3f71899

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

sigc++/connection.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ connection::connection() noexcept : slot_(nullptr)
2626
{
2727
}
2828

29-
connection::connection(slot_base* slot)
30-
: slot_(slot)
29+
connection::connection(slot_base& slot)
30+
: slot_(&slot)
3131
{
3232
if (slot_)
3333
slot_->add_destroy_notify_callback(this, &notify_slot_invalidated);

sigc++/connection.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,10 +48,10 @@ struct SIGC_API connection : public notifiable
4848
*/
4949
connection(const connection& c);
5050

51-
/** Constructs a connection object from a slot list iterator.
52-
* @param it The slot list iterator to take the slot from.
51+
/** Constructs a connection object from a slot object.
52+
* @param sl The slot to operate on.
5353
*/
54-
explicit connection(slot_base* slot);
54+
explicit connection(slot_base& slot);
5555

5656
/** Overrides this connection object copying another one.
5757
* @param c The connection object to make a copy from.

sigc++/signal.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -433,7 +433,7 @@ class signal_with_accumulator : public signal_base
433433
{
434434
auto iter = signal_base::connect(slot_);
435435
auto& slot_base = *iter;
436-
return connection(&slot_base);
436+
return connection(slot_base);
437437
}
438438

439439
/** Add a slot to the list of slots.
@@ -445,7 +445,7 @@ class signal_with_accumulator : public signal_base
445445
{
446446
auto iter = signal_base::connect(std::move(slot_));
447447
auto& slot_base = *iter;
448-
return connection(&slot_base);
448+
return connection(slot_base);
449449
}
450450

451451
/** Triggers the emission of the signal.

0 commit comments

Comments
 (0)