From cbeb882d6064161dd99890fe334052a61b3a0fca Mon Sep 17 00:00:00 2001 From: Gregory A Lundberg Date: Mon, 27 Aug 2018 19:35:04 -0500 Subject: [PATCH] Fix error: missing noexcept GCC 8.2.0 -Wnoexcept flags two functions which should be marked as not throwing. (cherry-picked from commit 3826c263b1ac203c5487c1a81000c3111bda263b) --- src/color.hpp | 2 +- src/map/location.hpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/color.hpp b/src/color.hpp index 199dc38ef8ed..4de7acffedb1 100644 --- a/src/color.hpp +++ b/src/color.hpp @@ -254,7 +254,7 @@ namespace std template<> struct hash { - std::size_t operator()(const color_t& c) const + std::size_t operator()(const color_t& c) const noexcept { return c.to_rgba_bytes(); } diff --git a/src/map/location.hpp b/src/map/location.hpp index 0694eaa8ef32..5ee8a28f5303 100644 --- a/src/map/location.hpp +++ b/src/map/location.hpp @@ -210,7 +210,7 @@ std::ostream &operator<<(std::ostream &s, const std::vector& v); namespace std { template<> struct hash { - std::size_t operator()(const map_location& l) const { + std::size_t operator()(const map_location& l) const noexcept { // The 2000 bias supposedly ensures that the correct x is recovered for negative y // This implementation copied from the Lua location_set return (l.wml_x()) * 16384 + (l.wml_y()) + 2000;