uuid_hash.hpp 851 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. //
  2. // Copyright (c) 2018 James E. King III
  3. //
  4. // Distributed under the Boost Software License, Version 1.0.
  5. // (See accompanying file LICENSE_1_0.txt or copy at
  6. // https://www.boost.org/LICENSE_1_0.txt)
  7. //
  8. // std::hash support for uuid
  9. //
  10. #ifndef BOOST_UUID_HASH_HPP
  11. #define BOOST_UUID_HASH_HPP
  12. #include <boost/config.hpp>
  13. #include <boost/container_hash/hash.hpp>
  14. #include <boost/uuid/uuid.hpp>
  15. #ifdef BOOST_HAS_PRAGMA_ONCE
  16. #pragma once
  17. #endif
  18. #ifndef BOOST_NO_CXX11_HDR_FUNCTIONAL
  19. #include <cstddef>
  20. #include <functional>
  21. namespace std
  22. {
  23. template<>
  24. struct hash<boost::uuids::uuid>
  25. {
  26. std::size_t operator () (const boost::uuids::uuid& value) const BOOST_NOEXCEPT
  27. {
  28. return boost::uuids::hash_value(value);
  29. }
  30. };
  31. }
  32. #endif /* !BOOST_NO_CXX11_HDR_FUNCTIONAL */
  33. #endif /* !BOOST_UUID_HASH_HPP */