diff --git a/src/client/List.cxx b/src/client/List.cxx index 56c83c88f..926a3ad2c 100644 --- a/src/client/List.cxx +++ b/src/client/List.cxx @@ -23,7 +23,7 @@ #include void -ClientList::Remove(Client &client) +ClientList::Remove(Client &client) noexcept { assert(!list.empty()); @@ -31,13 +31,13 @@ ClientList::Remove(Client &client) } void -ClientList::CloseAll() +ClientList::CloseAll() noexcept { list.clear_and_dispose(DeleteDisposer()); } void -ClientList::IdleAdd(unsigned flags) +ClientList::IdleAdd(unsigned flags) noexcept { assert(flags != 0); diff --git a/src/client/List.hxx b/src/client/List.hxx index dd95b5820..214a76838 100644 --- a/src/client/List.hxx +++ b/src/client/List.hxx @@ -33,33 +33,34 @@ class ClientList { List list; public: - ClientList(unsigned _max_size) + explicit ClientList(unsigned _max_size) noexcept :max_size(_max_size) {} - ~ClientList() { + + ~ClientList() noexcept { CloseAll(); } - List::iterator begin() { + List::iterator begin() noexcept { return list.begin(); } - List::iterator end() { + List::iterator end() noexcept { return list.end(); } - bool IsFull() const { + bool IsFull() const noexcept { return list.size() >= max_size; } - void Add(Client &client) { + void Add(Client &client) noexcept { list.push_front(client); } - void Remove(Client &client); + void Remove(Client &client) noexcept; - void CloseAll(); + void CloseAll() noexcept; - void IdleAdd(unsigned flags); + void IdleAdd(unsigned flags) noexcept; }; #endif