X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/96cedde3cdbc0b8ffc3f096a1b65d021b0226f99..396200308fb93b455f0e0fe14a8b64410e51671c:/include/xbt/utility.hpp diff --git a/include/xbt/utility.hpp b/include/xbt/utility.hpp index 84c282e7db..e80adf577a 100644 --- a/include/xbt/utility.hpp +++ b/include/xbt/utility.hpp @@ -8,10 +8,28 @@ #define XBT_UTILITY_HPP #include +#include namespace simgrid { namespace xbt { +/** @brief A hash which works with more stuff + * + * It can hash pairs: the standard hash currently doesn't include this. + */ +template class hash : public std::hash { +}; + +template class hash> { +public: + std::size_t operator()(std::pair const& x) const + { + hash h1; + hash h2; + return h1(x.first) ^ h2(x.second); + } +}; + /** @brief Comparator class for using with std::priority_queue or boost::heap. * * Compare two std::pair by their first element (of type double), and return true when the first is greater than the @@ -57,10 +75,6 @@ template inline void intrusive_erase(List& list, Elem& */ template class integer_sequence { - static constexpr std::size_t size() - { - return std::tuple_size::value; - } }; namespace bits {