Skip to content

Commit 4b90fad

Browse files
committed
STL add comments to sort_until.
1 parent 8028721 commit 4b90fad

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

STL_examples.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -566,12 +566,13 @@ TEST(sort, ExampleTwoWithPredicate) {
566566
TEST(is_sorted_until, ExampleOne) {
567567
std::vector<int> v{1, 2, 3, 4, 3, 5, 6};
568568
const auto iterator1 = std::is_sorted_until(v.cbegin(), v.cend());
569+
// Points to the last sorted element.
569570
EXPECT_EQ(*iterator1, 3);
570571
EXPECT_EQ(iterator1 - v.cbegin(), 4);
571572

572573
std::sort(v.begin(), v.end());
573574
const auto iterator2 = std::is_sorted_until(v.cbegin(), v.cend());
574-
EXPECT_EQ(iterator2, v.cend());
575+
EXPECT_EQ(iterator2, v.cend()); // All elements are sorted.
575576
EXPECT_EQ(iterator2 - v.cbegin(), 7);
576577
}
577578

0 commit comments

Comments
 (0)