Core/Signal: Make movement noexcept
This commit is contained in:
parent
ef474fc3a4
commit
353ade3efd
|
|
@ -69,7 +69,7 @@ namespace Nz
|
|||
SlotListIndex index;
|
||||
};
|
||||
|
||||
void Disconnect(const SlotPtr& slot);
|
||||
void Disconnect(const SlotPtr& slot) noexcept;
|
||||
|
||||
SlotList m_slots;
|
||||
mutable SlotListIndex m_slotIterator;
|
||||
|
|
@ -84,17 +84,17 @@ namespace Nz
|
|||
public:
|
||||
Connection() = default;
|
||||
Connection(const Connection& connection) = default;
|
||||
Connection(Connection&& connection) = default;
|
||||
Connection(Connection&& connection) noexcept = default;
|
||||
~Connection() = default;
|
||||
|
||||
template<typename... ConnectArgs>
|
||||
void Connect(BaseClass& signal, ConnectArgs&&... args);
|
||||
void Disconnect();
|
||||
void Disconnect() noexcept;
|
||||
|
||||
bool IsConnected() const;
|
||||
|
||||
Connection& operator=(const Connection& connection) = default;
|
||||
Connection& operator=(Connection&& connection) = default;
|
||||
Connection& operator=(Connection&& connection) noexcept = default;
|
||||
|
||||
private:
|
||||
Connection(const SlotPtr& slot);
|
||||
|
|
@ -113,12 +113,12 @@ namespace Nz
|
|||
ConnectionGuard(const Connection& connection);
|
||||
ConnectionGuard(const ConnectionGuard& connection) = delete;
|
||||
ConnectionGuard(Connection&& connection);
|
||||
ConnectionGuard(ConnectionGuard&& connection) = default;
|
||||
ConnectionGuard(ConnectionGuard&& connection) noexcept = default;
|
||||
~ConnectionGuard();
|
||||
|
||||
template<typename... ConnectArgs>
|
||||
void Connect(BaseClass& signal, ConnectArgs&&... args);
|
||||
void Disconnect();
|
||||
void Disconnect() noexcept;
|
||||
|
||||
Connection& GetConnection();
|
||||
|
||||
|
|
@ -127,7 +127,7 @@ namespace Nz
|
|||
ConnectionGuard& operator=(const Connection& connection);
|
||||
ConnectionGuard& operator=(const ConnectionGuard& connection) = delete;
|
||||
ConnectionGuard& operator=(Connection&& connection);
|
||||
ConnectionGuard& operator=(ConnectionGuard&& connection);
|
||||
ConnectionGuard& operator=(ConnectionGuard&& connection) noexcept;
|
||||
|
||||
private:
|
||||
Connection m_connection;
|
||||
|
|
|
|||
|
|
@ -205,7 +205,7 @@ namespace Nz
|
|||
*/
|
||||
|
||||
template<typename... Args>
|
||||
void Signal<Args...>::Disconnect(const SlotPtr& slot)
|
||||
void Signal<Args...>::Disconnect(const SlotPtr& slot) noexcept
|
||||
{
|
||||
NazaraAssert(slot, "Invalid slot pointer");
|
||||
NazaraAssert(slot->index < m_slots.size(), "Invalid slot index");
|
||||
|
|
@ -277,7 +277,7 @@ namespace Nz
|
|||
*/
|
||||
|
||||
template<typename... Args>
|
||||
void Signal<Args...>::Connection::Disconnect()
|
||||
void Signal<Args...>::Connection::Disconnect() noexcept
|
||||
{
|
||||
if (SlotPtr ptr = m_ptr.lock())
|
||||
ptr->signal->Disconnect(ptr);
|
||||
|
|
@ -353,7 +353,7 @@ namespace Nz
|
|||
*/
|
||||
|
||||
template<typename... Args>
|
||||
void Signal<Args...>::ConnectionGuard::Disconnect()
|
||||
void Signal<Args...>::ConnectionGuard::Disconnect() noexcept
|
||||
{
|
||||
m_connection.Disconnect();
|
||||
}
|
||||
|
|
@ -420,7 +420,7 @@ namespace Nz
|
|||
*/
|
||||
|
||||
template<typename... Args>
|
||||
typename Signal<Args...>::ConnectionGuard& Signal<Args...>::ConnectionGuard::operator=(ConnectionGuard&& connection)
|
||||
typename Signal<Args...>::ConnectionGuard& Signal<Args...>::ConnectionGuard::operator=(ConnectionGuard&& connection) noexcept
|
||||
{
|
||||
m_connection.Disconnect();
|
||||
m_connection = std::move(connection.m_connection);
|
||||
|
|
|
|||
Loading…
Reference in New Issue