mirror of
https://github.com/libSDL2pp/libSDL2pp.git
synced 2025-09-07 22:36:49 -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 {
|
namespace std {
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
/// \brief Hash function for SDL2pp::Point
|
/// \brief std::hash specialization for SDL2pp::Rect
|
||||||
///
|
|
||||||
/// \param[in] p Input Point
|
|
||||||
///
|
|
||||||
/// \returns Hash value
|
|
||||||
///
|
///
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
template<>
|
template<>
|
||||||
struct hash<SDL2pp::Point> {
|
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 operator()(const SDL2pp::Point& p) const {
|
||||||
size_t seed = std::hash<int>()(p.x);
|
size_t seed = std::hash<int>()(p.x);
|
||||||
seed ^= std::hash<int>()(p.y) + 0x9e3779b9 + (seed<<6) + (seed>>2);
|
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 {
|
namespace std {
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
/// \brief Hash function for SDL2pp::Rect
|
/// \brief std::hash specialization for SDL2pp::Rect
|
||||||
///
|
|
||||||
/// \param[in] r Input Rect
|
|
||||||
///
|
|
||||||
/// \returns Hash value
|
|
||||||
///
|
///
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
template<>
|
template<>
|
||||||
struct hash<SDL2pp::Rect> {
|
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 operator()(const SDL2pp::Rect& r) const {
|
||||||
size_t seed = std::hash<int>()(r.x);
|
size_t seed = std::hash<int>()(r.x);
|
||||||
seed ^= std::hash<int>()(r.y) + 0x9e3779b9 + (seed<<6) + (seed>>2);
|
seed ^= std::hash<int>()(r.y) + 0x9e3779b9 + (seed<<6) + (seed>>2);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user