• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 
2 // Copyright 2006-2009 Daniel James.
3 // Distributed under the Boost Software License, Version 1.0. (See accompanying
4 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
5 
6 #include "./config.hpp"
7 
8 #define BOOST_HASH_TEST_NAMESPACE boost
9 #include <boost/container_hash/hash.hpp>
10 #include <boost/core/lightweight_test.hpp>
11 #include <vector>
12 
f(std::size_t hash1,int * x1)13 int f(std::size_t hash1, int* x1) {
14 
15     // Check that BOOST_HASH_TEST_NAMESPACE::hash<int*> works in both files.
16     BOOST_HASH_TEST_NAMESPACE::hash<int*> ptr_hasher;
17     BOOST_TEST(hash1 == ptr_hasher(x1));
18 
19 #if defined(BOOST_HASH_TEST_EXTENSIONS)
20 
21     // Check that std::vector<std::size_t> is avaiable in this file.
22     std::vector<std::size_t> x;
23     x.push_back(static_cast<std::size_t>(*x1));
24     BOOST_HASH_TEST_NAMESPACE::hash<std::vector<std::size_t> > vector_hasher;
25     return vector_hasher(x) != BOOST_HASH_TEST_NAMESPACE::hash_value(x);
26 
27 #else
28 
29     return 0;
30 
31 #endif
32 }
33 
34