forked from boostorg/range
[range] Use correct iterator concepts when checking Boost.Range concepts (refs #6944).
[SVN r84566]
This commit is contained in:
@ -330,8 +330,8 @@ namespace boost {
|
|||||||
struct BidirectionalRangeConcept : ForwardRangeConcept<T>
|
struct BidirectionalRangeConcept : ForwardRangeConcept<T>
|
||||||
{
|
{
|
||||||
#if BOOST_RANGE_ENABLE_CONCEPT_ASSERT
|
#if BOOST_RANGE_ENABLE_CONCEPT_ASSERT
|
||||||
BOOST_RANGE_CONCEPT_ASSERT((BidirectionalIteratorConcept<BOOST_DEDUCED_TYPENAME BidirectionalRangeConcept::iterator>));
|
BOOST_RANGE_CONCEPT_ASSERT((range_detail::BidirectionalIteratorConcept<BOOST_DEDUCED_TYPENAME BidirectionalRangeConcept::iterator>));
|
||||||
BOOST_RANGE_CONCEPT_ASSERT((BidirectionalIteratorConcept<BOOST_DEDUCED_TYPENAME BidirectionalRangeConcept::const_iterator>));
|
BOOST_RANGE_CONCEPT_ASSERT((range_detail::BidirectionalIteratorConcept<BOOST_DEDUCED_TYPENAME BidirectionalRangeConcept::const_iterator>));
|
||||||
#endif
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -348,8 +348,8 @@ namespace boost {
|
|||||||
struct RandomAccessRangeConcept : BidirectionalRangeConcept<T>
|
struct RandomAccessRangeConcept : BidirectionalRangeConcept<T>
|
||||||
{
|
{
|
||||||
#if BOOST_RANGE_ENABLE_CONCEPT_ASSERT
|
#if BOOST_RANGE_ENABLE_CONCEPT_ASSERT
|
||||||
BOOST_RANGE_CONCEPT_ASSERT((RandomAccessIteratorConcept<BOOST_DEDUCED_TYPENAME RandomAccessRangeConcept::iterator>));
|
BOOST_RANGE_CONCEPT_ASSERT((range_detail::RandomAccessIteratorConcept<BOOST_DEDUCED_TYPENAME RandomAccessRangeConcept::iterator>));
|
||||||
BOOST_RANGE_CONCEPT_ASSERT((RandomAccessIteratorConcept<BOOST_DEDUCED_TYPENAME RandomAccessRangeConcept::const_iterator>));
|
BOOST_RANGE_CONCEPT_ASSERT((range_detail::RandomAccessIteratorConcept<BOOST_DEDUCED_TYPENAME RandomAccessRangeConcept::const_iterator>));
|
||||||
#endif
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -161,5 +161,6 @@ test-suite range :
|
|||||||
[ range-test ticket_5544_terminate_irange ]
|
[ range-test ticket_5544_terminate_irange ]
|
||||||
[ range-test ticket_5547 ]
|
[ range-test ticket_5547 ]
|
||||||
[ range-test ticket_5556_is_sorted_namespace ]
|
[ range-test ticket_5556_is_sorted_namespace ]
|
||||||
|
[ range-test ticket_6944 ]
|
||||||
;
|
;
|
||||||
|
|
||||||
|
45
test/ticket_6944.cpp
Normal file
45
test/ticket_6944.cpp
Normal file
@ -0,0 +1,45 @@
|
|||||||
|
// Boost.Range library
|
||||||
|
//
|
||||||
|
// Copyright Neil Groves 2011. Use, modification and
|
||||||
|
// distribution is subject to the Boost Software License, Version
|
||||||
|
// 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
||||||
|
// http://www.boost.org/LICENSE_1_0.txt)
|
||||||
|
//
|
||||||
|
//
|
||||||
|
// For more information, see http://www.boost.org/libs/range/
|
||||||
|
//
|
||||||
|
#include <boost/concept_check.hpp>
|
||||||
|
#include <boost/iterator/iterator_adaptor.hpp>
|
||||||
|
#include <boost/range/concepts.hpp>
|
||||||
|
#include <boost/range/iterator_range.hpp>
|
||||||
|
|
||||||
|
#include <boost/test/test_tools.hpp>
|
||||||
|
#include <boost/test/unit_test.hpp>
|
||||||
|
|
||||||
|
#include <vector>
|
||||||
|
|
||||||
|
namespace boost
|
||||||
|
{
|
||||||
|
namespace
|
||||||
|
{
|
||||||
|
// Ticket 6944 - Some Range concepts use the incorrect Iterator concept
|
||||||
|
typedef std::vector<int>::iterator iter_base;
|
||||||
|
struct iter : boost::iterator_adaptor<iter, iter_base, int, boost::use_default, int> {}; // will be deduced as random-access traversal but input category
|
||||||
|
typedef boost::iterator_range<iter> iter_range;
|
||||||
|
void test_ticket_6944()
|
||||||
|
{
|
||||||
|
BOOST_CONCEPT_ASSERT(( boost::RandomAccessRangeConcept<iter_range> ));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
boost::unit_test::test_suite*
|
||||||
|
init_unit_test_suite(int argc, char* argv[])
|
||||||
|
{
|
||||||
|
boost::unit_test::test_suite* test
|
||||||
|
= BOOST_TEST_SUITE( "RangeTestSuite.ticket_6944" );
|
||||||
|
|
||||||
|
test->add( BOOST_TEST_CASE( &boost::test_ticket_6944 ) );
|
||||||
|
|
||||||
|
return test;
|
||||||
|
}
|
Reference in New Issue
Block a user