| 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 | |
| 14 | #include <boost/test/test_tools.hpp> |
| 15 | #include <boost/test/unit_test.hpp> |
| 16 | |
| 17 | namespace boost |
| 18 | { |
| 19 | namespace |
| 20 | { |
| 21 | // Ticket 10336 - compilation error in iterator_range and unordered_map |
| 22 | void test_ticket_10336() |
| 23 | { |
| 24 | typedef boost::unordered_map<int,int> container_t; |
| 25 | typedef container_t::const_iterator citer_t; |
| 26 | typedef boost::iterator_range<citer_t> rng_t; |
| 27 | |
| 28 | const container_t c; |
| 29 | rng_t rng(c.begin(), c.end()); |
| 30 | } |
| 31 | } |
| 32 | } |
| 33 | |
| 34 | boost::unit_test::test_suite* |
| 35 | init_unit_test_suite(int argc, char* argv[]) |
| 36 | { |
| 37 | boost::unit_test::test_suite* test |
| 38 | = BOOST_TEST_SUITE( "RangeTestSuite.ticket_10336"); |
| 39 | |
| 40 | test->add( BOOST_TEST_CASE( &boost::test_ticket_10336 ) ); |
| 41 | |
| 42 | return test; |
| 43 | } |
| 44 |
