From a99694866cabe33368d357bc8e149173456b5d70 Mon Sep 17 00:00:00 2001 From: jie Date: Sat, 27 Nov 2021 09:22:57 +0800 Subject: [PATCH] fix bug: compilation failure on linux (missing noexcept for exception types) --- bserv/include/bserv/database.hpp | 2 +- bserv/include/bserv/utils.hpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/bserv/include/bserv/database.hpp b/bserv/include/bserv/database.hpp index 2c90854..02b8b4a 100644 --- a/bserv/include/bserv/database.hpp +++ b/bserv/include/bserv/database.hpp @@ -216,7 +216,7 @@ namespace bserv { class unsupported_json_value_type : public std::exception { public: unsupported_json_value_type() = default; - const char* what() const { return "unsupported json value type"; } + const char* what() const noexcept { return "unsupported json value type"; } }; template <> diff --git a/bserv/include/bserv/utils.hpp b/bserv/include/bserv/utils.hpp index 9bdf257..0069117 100644 --- a/bserv/include/bserv/utils.hpp +++ b/bserv/include/bserv/utils.hpp @@ -68,7 +68,7 @@ namespace bserv::utils { public: file_not_found(const std::string& filename) : msg_{ std::string{ "'" } + filename + "' does not exist" } {} - const char* what() const { return msg_.c_str(); } + const char* what() const noexcept { return msg_.c_str(); } }; std::string read_bin(const std::string& filename);