mirror of
https://github.com/libSDL2pp/libSDL2pp.git
synced 2025-08-03 10:55:57 -04:00
Improve documentation
This commit is contained in:
parent
fa3cb7bcd9
commit
43ebad282c
@ -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<SDL2pp::Point> {
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \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<int>()(p.x);
|
||||
seed ^= std::hash<int>()(p.y) + 0x9e3779b9 + (seed<<6) + (seed>>2);
|
||||
|
@ -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<SDL2pp::Rect> {
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \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<int>()(r.x);
|
||||
seed ^= std::hash<int>()(r.y) + 0x9e3779b9 + (seed<<6) + (seed>>2);
|
||||
|
Loading…
x
Reference in New Issue
Block a user