]> git.proxmox.com Git - ceph.git/blob - ceph/src/boost/boost/json/detail/hash_combine.hpp
update ceph source to reef 18.1.2
[ceph.git] / ceph / src / boost / boost / json / detail / hash_combine.hpp
1 //
2 // Copyright (c) 2019 Vinnie Falco (vinnie.falco@gmail.com)
3 //
4 // Distributed under the Boost Software License, Version 1.0. (See accompanying
5 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
6 //
7 // Official repository: https://github.com/boostorg/json
8 //
9
10 #ifndef BOOST_JSON_DETAIL_HASH_COMBINE_HPP
11 #define BOOST_JSON_DETAIL_HASH_COMBINE_HPP
12
13 BOOST_JSON_NS_BEGIN
14 namespace detail {
15
16 inline
17 std::size_t
18 hash_combine(
19 std::size_t seed,
20 std::size_t h) noexcept
21 {
22 seed ^= h + 0x9e3779b9 + (seed << 6U) + (seed >> 2U);
23 return seed;
24 }
25
26 inline
27 std::size_t
28 hash_combine_commutative(
29 std::size_t lhs,
30 std::size_t rhs) noexcept
31 {
32 return lhs ^ rhs;
33 }
34
35 } // detail
36 BOOST_JSON_NS_END
37
38 #endif