mirror of
https://github.com/boostorg/functional.git
synced 2025-08-02 22:14:28 +02:00
Reintroduce workaround for hashing const built-in array on Visual C++.
[SVN r33164]
This commit is contained in:
@@ -422,7 +422,11 @@ namespace boost
|
|||||||
template <class Array>
|
template <class Array>
|
||||||
struct inner
|
struct inner
|
||||||
{
|
{
|
||||||
|
#if !BOOST_WORKAROUND(BOOST_MSVC, < 1300)
|
||||||
static std::size_t call(Array const& v)
|
static std::size_t call(Array const& v)
|
||||||
|
#else
|
||||||
|
static std::size_t call(Array& v)
|
||||||
|
#endif
|
||||||
{
|
{
|
||||||
const int size = sizeof(v) / sizeof(*v);
|
const int size = sizeof(v) / sizeof(*v);
|
||||||
return boost::hash_range(v, v + size);
|
return boost::hash_range(v, v + size);
|
||||||
@@ -503,7 +507,7 @@ namespace boost
|
|||||||
{
|
{
|
||||||
std::size_t operator()(T const& val) const
|
std::size_t operator()(T const& val) const
|
||||||
{
|
{
|
||||||
return hash_detail::call_hash<T>::call(val);
|
return hash_detail::call_hash<T const>::call(val);
|
||||||
}
|
}
|
||||||
|
|
||||||
std::size_t operator()(T& val) const
|
std::size_t operator()(T& val) const
|
||||||
@@ -520,7 +524,7 @@ namespace boost
|
|||||||
struct inner
|
struct inner
|
||||||
: public std::unary_function<T, std::size_t>
|
: public std::unary_function<T, std::size_t>
|
||||||
{
|
{
|
||||||
std::size_t operator()(T const& val) const
|
std::size_t operator()(T& val) const
|
||||||
{
|
{
|
||||||
return hash_detail::call_hash<T>::call(val);
|
return hash_detail::call_hash<T>::call(val);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user