Use unique_ptr in Connection rather than a shared_ptr

This commit is contained in:
Thomas Goyne 2013-06-30 15:57:33 -07:00
parent 098ffd0a92
commit 8760c9a547
1 changed files with 3 additions and 1 deletions

View File

@ -52,10 +52,12 @@ namespace detail {
/// @class Connection
/// @brief Object representing a connection to a signal
class Connection {
std::shared_ptr<detail::ConnectionToken> token;
std::unique_ptr<detail::ConnectionToken> token;
public:
Connection() { }
Connection(Connection&& that) : token(std::move(that.token)) { }
Connection(detail::ConnectionToken *token) : token(token) { token->claimed = true; }
Connection& operator=(Connection&& that) { token = std::move(that.token); return *this; }
/// @brief End this connection
///