2006-02-13 18:26:00 +00:00
|
|
|
|
2008-06-12 00:27:13 +00:00
|
|
|
// Copyright 2006-2008 Daniel James.
|
2007-11-25 18:38:02 +00:00
|
|
|
// 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>
|
2008-06-12 00:27:13 +00:00
|
|
|
#include <boost/test/minimal.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;
|
2008-06-12 00:27:13 +00:00
|
|
|
BOOST_CHECK(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-25 15:59:08 +00:00
|
|
|
return vector_hasher(x) != HASH_NAMESPACE::hash_value(x);
|
2006-02-13 18:26:00 +00:00
|
|
|
}
|
|
|
|
|
|