[libsigcplusplus] Connection: Constructor: Take slot_base as reference.



commit 3f7189989cd0f9cc72983a735cf12725467c6722
Author: Murray Cumming <murrayc murrayc com>
Date:   Fri Apr 22 10:05:20 2016 +0200

    Connection: Constructor: Take slot_base as reference.
    
    This constructor existed before, so this avoids an API break.

 sigc++/connection.cc |    4 ++--
 sigc++/connection.h  |    6 +++---
 sigc++/signal.h      |    4 ++--
 3 files changed, 7 insertions(+), 7 deletions(-)
---
diff --git a/sigc++/connection.cc b/sigc++/connection.cc
index 61ba3e4..7f1ba8b 100644
--- a/sigc++/connection.cc
+++ b/sigc++/connection.cc
@@ -26,8 +26,8 @@ connection::connection() noexcept : slot_(nullptr)
 {
 }
 
-connection::connection(slot_base* slot)
-: slot_(slot)
+connection::connection(slot_base& slot)
+: slot_(&slot)
 {
   if (slot_)
     slot_->add_destroy_notify_callback(this, &notify_slot_invalidated);
diff --git a/sigc++/connection.h b/sigc++/connection.h
index 5a3c3be..e8ec869 100644
--- a/sigc++/connection.h
+++ b/sigc++/connection.h
@@ -48,10 +48,10 @@ struct SIGC_API connection : public notifiable
    */
   connection(const connection& c);
 
-  /** Constructs a connection object from a slot list iterator.
-   * @param it The slot list iterator to take the slot from.
+  /** Constructs a connection object from a slot object.
+   * @param sl The slot to operate on.
    */
-  explicit connection(slot_base* slot);
+  explicit connection(slot_base& slot);
 
   /** Overrides this connection object copying another one.
    * @param c The connection object to make a copy from.
diff --git a/sigc++/signal.h b/sigc++/signal.h
index 0a09d28..93ad824 100644
--- a/sigc++/signal.h
+++ b/sigc++/signal.h
@@ -433,7 +433,7 @@ public:
   {
     auto iter = signal_base::connect(slot_);
     auto& slot_base = *iter;
-    return connection(&slot_base);
+    return connection(slot_base);
   }
 
   /** Add a slot to the list of slots.
@@ -445,7 +445,7 @@ public:
   {
     auto iter = signal_base::connect(std::move(slot_));
     auto& slot_base = *iter;
-    return connection(&slot_base);
+    return connection(slot_base);
   }
 
   /** Triggers the emission of the signal.


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]