2006-02-13 18:26:00 +00:00
|
|
|
|
2006-06-25 09:59:05 +00:00
|
|
|
// Copyright 2006 Daniel James.
|
|
|
|
|
// Distributed under 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;
|
2007-02-24 22:40:59 +00:00
|
|
|
BOOST_TEST(vector_hasher(x) == HASH_NAMESPACE::hash_value(x));
|
|
|
|
|
return boost::report_errors();
|
2006-02-13 18:26:00 +00:00
|
|
|
}
|
|
|
|
|
|