forked from boostorg/container_hash
Remove Borland workarounds
This commit is contained in:
@@ -3,12 +3,12 @@
|
|||||||
// Distributed under the Boost Software License, Version 1.0.
|
// Distributed under the Boost Software License, Version 1.0.
|
||||||
// https://www.boost.org/LICENSE_1_0.txt
|
// https://www.boost.org/LICENSE_1_0.txt
|
||||||
|
|
||||||
// Based on Peter Dimov's proposal
|
// Based on Peter Dimov's proposal
|
||||||
// http://www.open-std.org/JTC1/SC22/WG21/docs/papers/2005/n1756.pdf
|
// http://www.open-std.org/JTC1/SC22/WG21/docs/papers/2005/n1756.pdf
|
||||||
// issue 6.18.
|
// issue 6.18.
|
||||||
//
|
//
|
||||||
// This also contains public domain code from MurmurHash. From the
|
// This also contains public domain code from MurmurHash. From the
|
||||||
// MurmurHash header:
|
// MurmurHash header:
|
||||||
|
|
||||||
// MurmurHash3 was written by Austin Appleby, and is placed in the public
|
// MurmurHash3 was written by Austin Appleby, and is placed in the public
|
||||||
// domain. The author hereby disclaims copyright to this source code.
|
// domain. The author hereby disclaims copyright to this source code.
|
||||||
@@ -448,32 +448,6 @@ namespace boost
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#if BOOST_WORKAROUND(BOOST_BORLANDC, BOOST_TESTED_AT(0x551))
|
|
||||||
template <class T>
|
|
||||||
inline std::size_t hash_range(T* first, T* last)
|
|
||||||
{
|
|
||||||
std::size_t seed = 0;
|
|
||||||
|
|
||||||
for(; first != last; ++first)
|
|
||||||
{
|
|
||||||
boost::hash<T> hasher;
|
|
||||||
seed ^= hasher(*first) + 0x9e3779b9 + (seed<<6) + (seed>>2);
|
|
||||||
}
|
|
||||||
|
|
||||||
return seed;
|
|
||||||
}
|
|
||||||
|
|
||||||
template <class T>
|
|
||||||
inline void hash_range(std::size_t& seed, T* first, T* last)
|
|
||||||
{
|
|
||||||
for(; first != last; ++first)
|
|
||||||
{
|
|
||||||
boost::hash<T> hasher;
|
|
||||||
seed ^= hasher(*first) + 0x9e3779b9 + (seed<<6) + (seed>>2);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
//
|
//
|
||||||
// boost::hash
|
// boost::hash
|
||||||
//
|
//
|
||||||
|
@@ -1,23 +1,13 @@
|
|||||||
|
|
||||||
// Copyright 2005-2009 Daniel James.
|
// Copyright 2005-2009 Daniel James.
|
||||||
// Distributed under the Boost Software License, Version 1.0. (See accompanying
|
// Copyright 2021 Peter Dimov.
|
||||||
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
// Distributed under the Boost Software License, Version 1.0.
|
||||||
|
// https://www.boost.org/LICENSE_1_0.txt
|
||||||
|
|
||||||
// Based on Peter Dimov's proposal
|
#ifndef BOOST_FUNCTIONAL_HASH_FWD_HPP
|
||||||
// http://www.open-std.org/JTC1/SC22/WG21/docs/papers/2005/n1756.pdf
|
|
||||||
// issue 6.18.
|
|
||||||
|
|
||||||
#if !defined(BOOST_FUNCTIONAL_HASH_FWD_HPP)
|
|
||||||
#define BOOST_FUNCTIONAL_HASH_FWD_HPP
|
#define BOOST_FUNCTIONAL_HASH_FWD_HPP
|
||||||
|
|
||||||
#include <boost/config/workaround.hpp>
|
|
||||||
#include <cstddef>
|
#include <cstddef>
|
||||||
|
|
||||||
#if defined(BOOST_HAS_PRAGMA_ONCE)
|
|
||||||
#pragma once
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
namespace boost
|
namespace boost
|
||||||
{
|
{
|
||||||
template <class T> struct hash;
|
template <class T> struct hash;
|
||||||
@@ -29,11 +19,6 @@ namespace boost
|
|||||||
|
|
||||||
template <class It> std::size_t hash_unordered_range(It, It);
|
template <class It> std::size_t hash_unordered_range(It, It);
|
||||||
template <class It> void hash_unordered_range(std::size_t&, It, It);
|
template <class It> void hash_unordered_range(std::size_t&, It, It);
|
||||||
|
|
||||||
#if BOOST_WORKAROUND(BOOST_BORLANDC, BOOST_TESTED_AT(0x551))
|
|
||||||
template <class T> inline std::size_t hash_range(T*, T*);
|
|
||||||
template <class T> inline void hash_range(std::size_t&, T*, T*);
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif // #ifndef BOOST_FUNCTIONAL_HASH_FWD_HPP
|
||||||
|
Reference in New Issue
Block a user