Make wxVector::reverse_iterator satisfy RandomAccessIterator
RandomAccessIterator requirements include LessThanComparable, so implement the missing comparison operators for this class, as well as for const_reverse_iterator. This also fixes compilation problems with MSVS 2013 in debug mode, where the CRT uses these operators to check the iterators correctness. See https://github.com/wxWidgets/wxWidgets/pull/1048
This commit is contained in:
@@ -365,6 +365,13 @@ TEST_CASE("wxVector::reverse_iterator", "[vector][reverse_iterator]")
|
||||
CHECK( ri - rb == 2 );
|
||||
CHECK( re - ri == 8 );
|
||||
|
||||
CHECK( rb < ri );
|
||||
CHECK( rb <= ri );
|
||||
CHECK( ri <= ri );
|
||||
CHECK( ri >= ri );
|
||||
CHECK( ri < re );
|
||||
CHECK( ri <= re );
|
||||
|
||||
#if wxUSE_STD_CONTAINERS_COMPATIBLY
|
||||
std::vector<int> stdvec(rb, re);
|
||||
REQUIRE( stdvec.size() == 10 );
|
||||
|
Reference in New Issue
Block a user