Compare commits

...

3 Commits

Author SHA1 Message Date
Daniel James
cffede428b Fix the link to the book example in the hash source documentation.
[SVN r31153]
2005-09-30 07:40:08 +00:00
Markus Schöpflin
29dce84d74 Workaround for Tru64/CXX std::numeric_limits::denorm_min() bug.
[SVN r31037]
2005-09-19 09:06:28 +00:00
Daniel James
6a591695b2 Fixed stupid error in hash point example.
[SVN r30609]
2005-08-20 20:39:21 +00:00
3 changed files with 9 additions and 4 deletions

View File

@@ -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;
}
};

View File

@@ -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));
}

View File

@@ -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.