• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 
11 #ifndef BOOST_UUID_HASH_HPP
12 #define BOOST_UUID_HASH_HPP
13 
14 #include <boost/config.hpp>
15 #include <boost/container_hash/hash.hpp>
16 #include <boost/uuid/uuid.hpp>
17 
18 #ifdef BOOST_HAS_PRAGMA_ONCE
19 #pragma once
20 #endif
21 
22 #ifndef BOOST_NO_CXX11_HDR_FUNCTIONAL
23 
24 #include <cstddef>
25 #include <functional>
26 
27 namespace std
28 {
29     template<>
30     struct hash<boost::uuids::uuid>
31     {
operator ()std::hash32         std::size_t operator () (const boost::uuids::uuid& value) const BOOST_NOEXCEPT
33         {
34             return boost::uuids::hash_value(value);
35         }
36     };
37 }
38 
39 #endif /* !BOOST_NO_CXX11_HDR_FUNCTIONAL */
40 #endif /* !BOOST_UUID_HASH_HPP */
41