Add noexcept qualifications in src/common

Apparently this can actually make a difference in some cases, and the
C++ Core Guideliens recommend doing this on all default constructors,
destructors, and all functions that can not throw (and thus also don't
allocate).
This commit is contained in:
Robbert van der Helm
2021-05-14 17:12:24 +02:00
parent db6ecdbbd4
commit 59ba2aeb5f
126 changed files with 536 additions and 515 deletions
+4 -1
View File
@@ -217,7 +217,7 @@ class Sockets {
*
* @note Classes overriding this should call `close()` in their destructor.
*/
virtual ~Sockets() {
virtual ~Sockets() noexcept {
try {
// NOTE: Because someone has wiped their home directory in the past
// by manually modifying the socket base directory argument
@@ -239,6 +239,9 @@ class Sockets {
// There should not be any filesystem errors since only one side
// removes the files, but if we somehow can't delete the file
// then we can just silently ignore this
} catch (const std::bad_alloc&) {
// If we cannot clean up because we're out of memory, then that's
// fine
}
}