ticket_10336.cpp 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. // Boost.Range library
  2. //
  3. // Copyright Neil Groves 2011. Use, modification and
  4. // distribution is subject to the Boost Software License, Version
  5. // 1.0. (See accompanying file LICENSE_1_0.txt or copy at
  6. // http://www.boost.org/LICENSE_1_0.txt)
  7. //
  8. //
  9. // For more information, see http://www.boost.org/libs/range/
  10. //
  11. #include <boost/range/iterator_range.hpp>
  12. #include <boost/unordered_map.hpp>
  13. #include <boost/test/test_tools.hpp>
  14. #include <boost/test/unit_test.hpp>
  15. namespace boost
  16. {
  17. namespace
  18. {
  19. // Ticket 10336 - compilation error in iterator_range and unordered_map
  20. void test_ticket_10336()
  21. {
  22. typedef boost::unordered_map<int,int> container_t;
  23. typedef container_t::const_iterator citer_t;
  24. typedef boost::iterator_range<citer_t> rng_t;
  25. const container_t c;
  26. rng_t rng(c.begin(), c.end());
  27. }
  28. }
  29. }
  30. boost::unit_test::test_suite*
  31. init_unit_test_suite(int argc, char* argv[])
  32. {
  33. boost::unit_test::test_suite* test
  34. = BOOST_TEST_SUITE( "RangeTestSuite.ticket_10336" );
  35. test->add( BOOST_TEST_CASE( &boost::test_ticket_10336 ) );
  36. return test;
  37. }