diff --git a/include/sol/optional_implementation.hpp b/include/sol/optional_implementation.hpp index 754e2731..4bb72d6a 100644 --- a/include/sol/optional_implementation.hpp +++ b/include/sol/optional_implementation.hpp @@ -657,7 +657,7 @@ namespace sol { class bad_optional_access : public std::exception { public: bad_optional_access() = default; - const char* what() const noexcept { + const char* what() const noexcept override { return "Optional has no value"; } }; diff --git a/single/include/sol/sol.hpp b/single/include/sol/sol.hpp index 9de93275..75e4cc5b 100644 --- a/single/include/sol/sol.hpp +++ b/single/include/sol/sol.hpp @@ -4631,7 +4631,7 @@ namespace sol { class bad_optional_access : public std::exception { public: bad_optional_access() = default; - const char* what() const noexcept { + const char* what() const noexcept override { return "Optional has no value"; } };