hash_no_ext_macro_1.cpp 945 B

12345678910111213141516171819202122232425262728293031323334353637
  1. // Copyright 2006-2009 Daniel James.
  2. // Distributed under the Boost Software License, Version 1.0. (See accompanying
  3. // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
  4. #include "./config.hpp"
  5. #if defined(BOOST_HASH_TEST_EXTENSIONS)
  6. // Include header without BOOST_HASH_NO_EXTENSIONS defined
  7. # if defined(BOOST_HASH_NO_EXTENSIONS)
  8. # undef BOOST_HASH_NO_EXTENSIONS
  9. # endif
  10. # include <boost/container_hash/hash.hpp>
  11. // Include header with BOOST_HASH_NO_EXTENSIONS defined
  12. # define BOOST_HASH_NO_EXTENSIONS
  13. # include <boost/container_hash/hash.hpp>
  14. #endif
  15. #include <boost/core/lightweight_test.hpp>
  16. #include <deque>
  17. int main()
  18. {
  19. #if defined(BOOST_HASH_TEST_EXTENSIONS)
  20. std::deque<int> x;
  21. x.push_back(1);
  22. x.push_back(2);
  23. BOOST_HASH_TEST_NAMESPACE::hash<std::deque<int> > hasher;
  24. BOOST_TEST(hasher(x) == BOOST_HASH_TEST_NAMESPACE::hash_value(x));
  25. #endif
  26. return boost::report_errors();
  27. }