diff --git a/src/Debug.hpp b/src/Debug.hpp index 82cda1d..bcebcb5 100644 --- a/src/Debug.hpp +++ b/src/Debug.hpp @@ -25,7 +25,7 @@ class LogUtil //replaces std::clog, std::cerr, std::cout with file streams { static LogUtil lu; } - ~LogUtil() noexcept + ~LogUtil() { std::clog.rdbuf(clogbuf), clogbuf = nullptr; std::cerr.rdbuf(cerrbuf), cerrbuf = nullptr; diff --git a/src/Exception.hpp b/src/Exception.hpp index e9d9b85..f6f3a53 100644 --- a/src/Exception.hpp +++ b/src/Exception.hpp @@ -21,7 +21,7 @@ namespace chesspp Exception(Exception &&) noexcept = default; Exception &operator=(Exception const &) = default; Exception &operator=(Exception &&) = default; - virtual ~Exception() noexcept = default; + virtual ~Exception() = default; virtual bool operator==(std::exception const &other) const noexcept { diff --git a/src/README.md b/src/README.md index 88646c4..efbd024 100644 --- a/src/README.md +++ b/src/README.md @@ -29,6 +29,7 @@ Style Guide & Coding Conventions - Prefer inlining functions, ctors, and dtors, so long as they do not increase header file coupling. - Try to make as many functions `noexcept` as possible, or at least use the conditional `noexcept` syntax. - If a function is known for throwing exceptions, write `noexcept(false)` as a visual indicator. +- Destructors are `noexcept(true)` by default, do not put the `noexcept` specifier on a dtor unless it is conditional or `noexcept(false)`. - Try to avoid excess or repetitive "access:" specifiers. - Avoid strange spaces before open parens and open braces and in other places unless you are lining up code with other code for readability and emphasis of relation. - There is no line character limit, but that is because you shouldn't have exceedingly long lines (unless they just have exceedingly long identifiers). Instead, avoid deeply nested compound expressions - they reduce readability and hinder understanding of what code is for and/or doing. diff --git a/src/ResourceManager.hpp b/src/ResourceManager.hpp index 235eb84..bd10a5d 100644 --- a/src/ResourceManager.hpp +++ b/src/ResourceManager.hpp @@ -24,7 +24,7 @@ namespace chesspp ResourceManager() noexcept { } - ~ResourceManager() noexcept + ~ResourceManager() { } diff --git a/src/SFMLEvent.hpp b/src/SFMLEvent.hpp index b04666b..1babb21 100644 --- a/src/SFMLEvent.hpp +++ b/src/SFMLEvent.hpp @@ -34,7 +34,7 @@ namespace chesspp virtual void OnJoystickConnected (uint joystickID) noexcept {} virtual void OnJoystickDisconnected (uint joystickID) noexcept {} - virtual ~SFMLEvent() noexcept + virtual ~SFMLEvent() { } }; diff --git a/src/board/Board.hpp b/src/board/Board.hpp index 083d4e2..ff90e7f 100644 --- a/src/board/Board.hpp +++ b/src/board/Board.hpp @@ -51,7 +51,7 @@ namespace chesspp Piece *selectedPiece = nullptr; Board(); - ~Board() noexcept; + ~Board(); // Loads the game from new_game.txt bool newGame(std::string const &fileName); diff --git a/src/config/Configuration.hpp b/src/config/Configuration.hpp index f3f3c2f..c0b66f6 100644 --- a/src/config/Configuration.hpp +++ b/src/config/Configuration.hpp @@ -70,7 +70,7 @@ namespace chesspp Configuration(const std::string &configFile) noexcept(false) : res_path(getResourcePath()), reader(std::ifstream(getResourcePath() + configFile)) { } - virtual ~Configuration() noexcept + virtual ~Configuration() { } diff --git a/src/util/JsonReader.hpp b/src/util/JsonReader.hpp index d7408f4..7b23d74 100644 --- a/src/util/JsonReader.hpp +++ b/src/util/JsonReader.hpp @@ -32,7 +32,7 @@ namespace chesspp JsonReader(std::istream &&s) noexcept(false) : JsonReader(s) { } - ~JsonReader() noexcept + ~JsonReader() { json_value_free(json), json = nullptr; } @@ -49,7 +49,7 @@ namespace chesspp NestedValue(NestedValue const &) noexcept = default; NestedValue(NestedValue &&) noexcept = default; NestedValue &operator=(NestedValue &&) noexcept = default; - ~NestedValue() noexcept = default; + ~NestedValue() = default; json_type type() const noexcept //may wish to add an abstraction layer between json-parser {