Compare commits

...

2 Commits

Author SHA1 Message Date
Peter Dimov b147799665 Remove local hash_value overload; boost::hash supports array-like types natively. 2025-01-26 20:35:19 +02:00
Peter Dimov acef60446a Update revision history 2025-01-26 20:31:53 +02:00
2 changed files with 2 additions and 8 deletions
+2
View File
@@ -16,3 +16,5 @@ http://www.boost.org/LICENSE_1_0.txt
* Added `noexcept` and `constexpr` as appropriate. * Added `noexcept` and `constexpr` as appropriate.
* Marked obsolete functions as deprecated. * Marked obsolete functions as deprecated.
* Removed obsolete compiler workarounds. * Removed obsolete compiler workarounds.
* Changed `array<T, 0>::begin()`, `cbegin()`, `end()`, `cend()` to return `nullptr`, enabling `constexpr`.
This matches the behavior of `std::array`.
-8
View File
@@ -395,14 +395,6 @@ namespace boost {
return arg.elems; return arg.elems;
} }
template <class It> std::size_t hash_range(It, It);
template<class T, std::size_t N>
std::size_t hash_value(const array<T,N>& arr)
{
return boost::hash_range(arr.begin(), arr.end());
}
template <size_t Idx, typename T, size_t N> template <size_t Idx, typename T, size_t N>
BOOST_CXX14_CONSTEXPR T &get(boost::array<T,N> &arr) BOOST_NOEXCEPT { BOOST_CXX14_CONSTEXPR T &get(boost::array<T,N> &arr) BOOST_NOEXCEPT {
BOOST_STATIC_ASSERT_MSG ( Idx < N, "boost::get<>(boost::array &) index out of range" ); BOOST_STATIC_ASSERT_MSG ( Idx < N, "boost::get<>(boost::array &) index out of range" );