hash_fwd_test_2.cpp 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  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. // This test just makes sure a header which uses hash_fwd can compile without
  5. // the main hash headers.
  6. #include "./config.hpp"
  7. #if !defined(BOOST_HASH_TEST_EXTENSIONS) || defined(BOOST_HASH_TEST_STD_INCLUDES)
  8. int main() {}
  9. #else
  10. #include "./hash_fwd_test.hpp"
  11. #include <boost/core/lightweight_test.hpp>
  12. template <class T> void unused(T const&) {}
  13. void fwd_test()
  14. {
  15. test::test_type1<int> x1(3);
  16. test::test_type1<std::string> y1("Black");
  17. test::test_type2<int> x2(25, 16);
  18. test::test_type2<std::string> y2("White", "Green");
  19. std::vector<int> empty;
  20. std::vector<std::string> empty2;
  21. test::test_type3<int> x3(empty.begin(), empty.end());
  22. test::test_type3<std::string> y3(empty2.begin(), empty2.end());
  23. // Prevent gcc warnings:
  24. unused(x1); unused(x2); unused(x3);
  25. unused(y1); unused(y2); unused(y3);
  26. }
  27. int main()
  28. {
  29. fwd_test();
  30. return boost::report_errors();
  31. }
  32. #endif // defined(BOOST_HASH_TEST_EXTENSIONS) && !defined(BOOST_HASH_TEST_STD_INCLUDES)