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 /// @class Connection
/// @brief Object representing a connection to a signal /// @brief Object representing a connection to a signal
class Connection { class Connection {
std::shared_ptr<detail::ConnectionToken> token; std::unique_ptr<detail::ConnectionToken> token;
public: public:
Connection() { } Connection() { }
Connection(Connection&& that) : token(std::move(that.token)) { }
Connection(detail::ConnectionToken *token) : token(token) { token->claimed = true; } Connection(detail::ConnectionToken *token) : token(token) { token->claimed = true; }
Connection& operator=(Connection&& that) { token = std::move(that.token); return *this; }
/// @brief End this connection /// @brief End this connection
/// ///