Skip to content

Commit 70cbee3

Browse files
richardeakinandrewfb
authored andcommitted
Added noexcept to signals move constructors and assignment operators.
Fixes #1681.
1 parent b64dc03 commit 70cbee3

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

include/cinder/Signals.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -123,9 +123,9 @@ class CI_API Connection {
123123
Connection();
124124
Connection( const std::shared_ptr<detail::Disconnector> &disconnector, detail::SignalLinkBase *link, int priority );
125125
Connection( const Connection &other );
126-
Connection( Connection &&other );
126+
Connection( Connection &&other ) noexcept;
127127
Connection& operator=( const Connection &rhs );
128-
Connection& operator=( Connection &&rhs );
128+
Connection& operator=( Connection &&rhs ) noexcept;
129129

130130
//! Disconnects this Connection from the callback chain. \a return true if a disconnection was made, false otherwise.
131131
bool disconnect();
@@ -150,9 +150,9 @@ class CI_API ScopedConnection : public Connection, private Noncopyable {
150150
public:
151151
ScopedConnection();
152152
~ScopedConnection();
153-
ScopedConnection( ScopedConnection &&other );
154-
ScopedConnection( Connection &&other );
155-
ScopedConnection& operator=( ScopedConnection &&rhs );
153+
ScopedConnection( ScopedConnection &&other ) noexcept;
154+
ScopedConnection( Connection &&other ) noexcept;
155+
ScopedConnection& operator=( ScopedConnection &&rhs ) noexcept;
156156
};
157157

158158
// ----------------------------------------------------------------------------------------------------

src/cinder/Signals.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ Connection::Connection( const Connection &other )
4242
{
4343
}
4444

45-
Connection::Connection( Connection &&other )
45+
Connection::Connection( Connection &&other ) noexcept
4646
: mDisconnector( move( other.mDisconnector ) ), mLink( move( other.mLink ) ), mPriority( move( other.mPriority ) )
4747
{
4848
}
@@ -56,7 +56,7 @@ Connection& Connection::operator=( const Connection &rhs )
5656
return *this;
5757
}
5858

59-
Connection& Connection::operator=( Connection &&rhs )
59+
Connection& Connection::operator=( Connection &&rhs ) noexcept
6060
{
6161
mDisconnector = move( rhs.mDisconnector );
6262
mLink = move( rhs.mLink );
@@ -117,17 +117,17 @@ ScopedConnection::~ScopedConnection()
117117
disconnect();
118118
}
119119

120-
ScopedConnection::ScopedConnection( ScopedConnection &&other )
120+
ScopedConnection::ScopedConnection( ScopedConnection &&other ) noexcept
121121
: Connection( std::move( other ) )
122122
{
123123
}
124124

125-
ScopedConnection::ScopedConnection( Connection &&other )
125+
ScopedConnection::ScopedConnection( Connection &&other ) noexcept
126126
: Connection( std::move( other ) )
127127
{
128128
}
129129

130-
ScopedConnection& ScopedConnection::operator=( ScopedConnection &&rhs )
130+
ScopedConnection& ScopedConnection::operator=( ScopedConnection &&rhs ) noexcept
131131
{
132132
disconnect(); // first disconnect from existing
133133
Connection::operator=( std::move( rhs ) );

0 commit comments

Comments
 (0)