diff --git a/SDL2pp/Point.hh b/SDL2pp/Point.hh index 3b9c693..de188b6 100644 --- a/SDL2pp/Point.hh +++ b/SDL2pp/Point.hh @@ -475,15 +475,19 @@ std::ostream& operator<<(std::ostream& stream, const SDL2pp::Point& point); namespace std { //////////////////////////////////////////////////////////// -/// \brief Hash function for SDL2pp::Point -/// -/// \param[in] p Input Point -/// -/// \returns Hash value +/// \brief std::hash specialization for SDL2pp::Rect /// //////////////////////////////////////////////////////////// template<> struct hash { + //////////////////////////////////////////////////////////// + /// \brief Hash function for SDL2pp::Point + /// + /// \param[in] p Input Point + /// + /// \returns Hash value + /// + //////////////////////////////////////////////////////////// size_t operator()(const SDL2pp::Point& p) const { size_t seed = std::hash()(p.x); seed ^= std::hash()(p.y) + 0x9e3779b9 + (seed<<6) + (seed>>2); diff --git a/SDL2pp/Rect.hh b/SDL2pp/Rect.hh index 4efeb2d..81691a7 100644 --- a/SDL2pp/Rect.hh +++ b/SDL2pp/Rect.hh @@ -550,15 +550,19 @@ std::ostream& operator<<(std::ostream& stream, const SDL2pp::Rect& rect); namespace std { //////////////////////////////////////////////////////////// -/// \brief Hash function for SDL2pp::Rect -/// -/// \param[in] r Input Rect -/// -/// \returns Hash value +/// \brief std::hash specialization for SDL2pp::Rect /// //////////////////////////////////////////////////////////// template<> struct hash { + //////////////////////////////////////////////////////////// + /// \brief Hash function for SDL2pp::Rect + /// + /// \param[in] r Input Rect + /// + /// \returns Hash value + /// + //////////////////////////////////////////////////////////// size_t operator()(const SDL2pp::Rect& r) const { size_t seed = std::hash()(r.x); seed ^= std::hash()(r.y) + 0x9e3779b9 + (seed<<6) + (seed>>2);