| 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 | #if defined(BOOST_HASH_TEST_EXTENSIONS) |
| 9 | |
| 10 | // Include header with BOOST_HASH_NO_EXTENSIONS defined |
| 11 | # if !defined(BOOST_HASH_NO_EXTENSIONS) |
| 12 | # define BOOST_HASH_NO_EXTENSIONS |
| 13 | # endif |
| 14 | # include <boost/container_hash/hash.hpp> |
| 15 | |
| 16 | // Include header without BOOST_HASH_NO_EXTENSIONS defined |
| 17 | # undef BOOST_HASH_NO_EXTENSIONS |
| 18 | # include <boost/container_hash/hash.hpp> |
| 19 | #endif |
| 20 | |
| 21 | #include <boost/core/lightweight_test.hpp> |
| 22 | #include <map> |
| 23 | |
| 24 | int main() |
| 25 | { |
| 26 | #if defined(BOOST_HASH_TEST_EXTENSIONS) |
| 27 | std::map<int, int> x; |
| 28 | |
| 29 | x.insert(x: std::map<int, int>::value_type(53, -42)); |
| 30 | x.insert(x: std::map<int, int>::value_type(14, -75)); |
| 31 | |
| 32 | BOOST_HASH_TEST_NAMESPACE::hash<std::map<int, int> > hasher; |
| 33 | BOOST_TEST(hasher(x) == BOOST_HASH_TEST_NAMESPACE::hash_value(x)); |
| 34 | #endif |
| 35 | |
| 36 | return boost::report_errors(); |
| 37 | } |
| 38 |
