blob: d15af569e47738d737a39b18d14efdf961f238cf [file] [log] [blame]
Jeff Thompsona28eed82013-08-22 16:21:10 -07001
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 ndnboost
9#include <boost/functional/hash.hpp>
10#include <boost/detail/lightweight_test.hpp>
11#include <vector>
12
13int 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(*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