adjacent_filtered's postcondition doesn't correctly describe behaviour
Nobody has claimed this yet.
Assessment
- Difficulty
- 1/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 52/100
- Issue type
- Documentation
- Clarity
- Clearly specified
- Activity status
- Stale
- Tech stack
- cpp
- Domain
- documentation
Research direction
Open the adjacent_filtered reference documentation linked in the issue and locate its postcondition. Compare that statement with the provided C++ example, revise the wording to match the demonstrated behavior, and verify that the rendered documentation accurately describes the invariant.
Written by the indexing model from the issue text.
Description
I think the documentation for adjacent_filtered's postcondition, ie:
For all adjacent elements
[x,y]in the returned range,bi_pred(x,y)istrue.
…isn't quite right. For example, this:
#include <boost/range/adaptor/adjacent_filtered.hpp>
#include <iostream>
#include <vector>
int main() {
const std::vector<int> a = { 0, 1, 2, 3, 4, 5, 6 };
const auto b = a | boost::adaptors::adjacent_filtered(
[] (const int &x, const int &y) {
return ( y % 2 == 1 ) && ( y == x + 1 );
}
);
for (const auto &x : b) {
std::cerr << x << "\n";
}
}
…outputs:
0
1
3
5
Yet two of the pairs of adjacent elements [x,y] in this range fail bi_pred(x,y) (because they differ by 2, not 1).
I think it's more like: bi_pred is true on each element in the returned range preceded by the element that preceded it in the original range (not in the returned range).
- Dominant language
- C++
- Stars
- 45
- Forks
- 104
- PR merge metrics
- No merged PRs in 30d
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from boostorg/range
-
Difficulty 1/5 Under an hour Newbie friendliness 65/100
-
Difficulty 1/5 Under an hour Newbie friendliness 70/100
-
Difficulty 3/5 1-2 days Newbie friendliness 45/100
-
Difficulty 3/5 1-2 days Newbie friendliness 38/100
-
Bad is_sorted docsOpen
Difficulty 1/5 Under an hour Newbie friendliness 55/100
Similar issues
-
HasBacktrace Priority-Critical
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
azerothcore/azerothcore-wotlk#27921 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 88/100
yhirose/cpp-peglib#344 ·
-
bug-unconfirmed
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
shadps4-emu/shadps4-qtlauncher#453 ·
Maintainers usually reply within 2 days