Improve documentation

This commit is contained in:
Dmitry Marakasov 2015-11-26 14:23:03 +03:00
parent fa3cb7bcd9
commit 43ebad282c
2 changed files with 18 additions and 10 deletions

View File

@ -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);

View File

@ -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);