Skip to content

Commit fb964d7

Browse files
authored
Updated documentation for is_palindrome
Added two lines with examples.
1 parent 366274f commit fb964d7

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

doc/is_palindrome.qbk

+6-2
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,9 @@ Given the containers:
4545
const std::list<int> empty,
4646
const std::vector<char> singleElement{'z'},
4747
int oddNonPalindrome[] = {3,2,2},
48-
const int evenPalindrome[] = {1,2,2,1}, then
48+
const int oddPalindrome[] = {1,2,3,2,1},
49+
const int evenPalindrome[] = {1,2,2,1},
50+
int evenNonPalindrome[] = {1,4,8,8}, then
4951
``
5052

5153
is_palindrome(empty)) --> true //empty range
@@ -54,7 +56,9 @@ is_palindrome(std::begin(oddNonPalindrome), std::end(oddNonPalindrome))) --> fal
5456
is_palindrome(std::begin(evenPalindrome), std::end(evenPalindrome))) --> true
5557
is_palindrome(empty.begin(), empty.end(), functorComparator())) --> true //empty range
5658
is_palindrome(std::begin(oddNonPalindrome), std::end(oddNonPalindrome), funcComparator<int>)) --> false
57-
is_palindrome(evenPalindrome, std::equal_to<int>())) --> true
59+
is_palindrome(std::begin(oddPalindrome), std::end(oddPalindrome)) --> true
60+
is_palindrome(evenPalindrome, std::equal_to<int>())) --> true
61+
is_palindrome(std::begin(evenNonPalindrome), std::end(evenNonPalindrome)) --> false
5862
``
5963

6064
[heading Iterator Requirements]

0 commit comments

Comments
 (0)