2006-02-13 18:26:00 +00:00
|
|
|
|
2006-03-18 15:49:21 +00:00
|
|
|
// Copyright Daniel James 2006. Use, modification, and distribution are
|
|
|
|
|
// subject to the Boost Software License, Version 1.0. (See accompanying
|
|
|
|
|
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
2006-02-13 18:26:00 +00:00
|
|
|
|
|
|
|
|
#define HASH_NAMESPACE boost
|
|
|
|
|
#include <boost/functional/hash.hpp>
|
2006-02-19 15:03:31 +00:00
|
|
|
#include <boost/detail/lightweight_test.hpp>
|
2006-02-13 18:26:00 +00:00
|
|
|
#include <vector>
|
|
|
|
|
|
|
|
|
|
int f(std::size_t hash1, int* x1) {
|
|
|
|
|
// Check that HASH_NAMESPACE::hash<int*> works in both files.
|
|
|
|
|
HASH_NAMESPACE::hash<int*> ptr_hasher;
|
2006-02-19 15:03:31 +00:00
|
|
|
BOOST_TEST(hash1 == ptr_hasher(x1));
|
2006-02-13 18:26:00 +00:00
|
|
|
|
|
|
|
|
// Check that std::vector<std::size_t> is avaiable in this file.
|
|
|
|
|
std::vector<std::size_t> x;
|
|
|
|
|
x.push_back(*x1);
|
|
|
|
|
HASH_NAMESPACE::hash<std::vector<std::size_t> > vector_hasher;
|
|
|
|
|
return vector_hasher(x) != HASH_NAMESPACE::hash_value(x);
|
|
|
|
|
}
|
|
|
|
|
|