mirror of
https://github.com/boostorg/container_hash.git
synced 2026-03-07 14:34:11 +01:00
Compare commits
3 Commits
feature/gh
...
boost-1.33
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
cffede428b | ||
|
|
29dce84d74 | ||
|
|
6a591695b2 |
@@ -180,7 +180,7 @@ And you can now use __boost_hash with book:
|
||||
assert(books.find(dandelion) == books.end());
|
||||
|
||||
The full example can be found in:
|
||||
[@../../libs/functional/hash/examples/books.cpp /libs/functional/hash/examples/books.hpp]
|
||||
[@../../libs/functional/hash/examples/books.hpp /libs/functional/hash/examples/books.hpp]
|
||||
and
|
||||
[@../../libs/functional/hash/examples/books.cpp /libs/functional/hash/examples/books.cpp].
|
||||
|
||||
@@ -209,7 +209,7 @@ Say you have a point class, representing a two dimensional location:
|
||||
|
||||
bool operator==(point const& other) const
|
||||
{
|
||||
return x = other.x && y == other.y;
|
||||
return x == other.x && y == other.y;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -20,7 +20,7 @@ public:
|
||||
|
||||
bool operator==(point const& other) const
|
||||
{
|
||||
return x = other.x && y == other.y;
|
||||
return x == other.x && y == other.y;
|
||||
}
|
||||
|
||||
friend std::size_t hash_value(point const& p)
|
||||
@@ -49,3 +49,4 @@ int main()
|
||||
assert(point_hasher(p1) != point_hasher(p2));
|
||||
assert(point_hasher(p1) != point_hasher(p3));
|
||||
}
|
||||
|
||||
|
||||
@@ -86,7 +86,6 @@ void float_tests(char const* name, T* = 0)
|
||||
std::cout<<"x1(denorm_min) == x1(-infinity) == "<<x1(minus_infinity)<<"\n";
|
||||
}
|
||||
}
|
||||
|
||||
if(std::numeric_limits<T>::has_quiet_NaN) {
|
||||
if(x1(std::numeric_limits<T>::quiet_NaN()) == x1(infinity)) {
|
||||
std::cout<<"x1(quiet_NaN) == x1(infinity) == "<<x1(infinity)<<"\n";
|
||||
@@ -136,6 +135,10 @@ void float_tests(char const* name, T* = 0)
|
||||
if(x1(std::numeric_limits<T>::denorm_min()) == x1(zero)) {
|
||||
std::cout<<"x1(denorm_min) == x1(zero) == "<<x1(zero)<<"\n";
|
||||
}
|
||||
#if !BOOST_WORKAROUND(__DECCXX_VER,<70190006)
|
||||
// The Tru64/CXX standard library prior to 7.1 contains a bug in the
|
||||
// specialization of std::numeric_limits::denorm_min() for long
|
||||
// doubles which causes this test to fail.
|
||||
BOOST_CHECK_MESSAGE(x1(std::numeric_limits<T>::denorm_min()) ==
|
||||
HASH_NAMESPACE::hash_value(std::numeric_limits<T>::denorm_min()),
|
||||
"x1(std::numeric_limits<T>::denorm_min()) = "
|
||||
@@ -144,6 +147,7 @@ void float_tests(char const* name, T* = 0)
|
||||
<< HASH_NAMESPACE::hash_value(
|
||||
std::numeric_limits<T>::denorm_min())
|
||||
<< "\nx1(0) = "<<x1(0)<<"\n");
|
||||
#endif
|
||||
}
|
||||
|
||||
// NaN also causes borland to crash.
|
||||
|
||||
Reference in New Issue
Block a user