combine() fails on containers with different size
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 45/100
Research direction
Reproduce the provided C++ example and start by reading boost/range/combine.hpp, the entry point named by the include. Trace iteration and size handling when the containers differ in length. Done means the combined view stops safely at the shorter container without accessing past vec1.end(), while retaining the demonstrated size and pairs.
Written by the indexing model from the issue text.
Description
The code
#include <iostream>
#include <vector>
#include <boost/range/combine.hpp>
#include <boost/tuple/tuple.hpp>
int main() {
std::vector vec1 = { 1, 2 };
std::vector vec2 = { 5, 6, 7 };
const auto& zip_view = boost::range::combine(vec1, vec2);
std::cout << "boost::range::combine(vec1, vec2).size() = " << std::ranges::size(zip_view) << std::endl;
for (auto const& zipped : zip_view) {
int first, second;
boost::tie(first, second) = zipped;
std::cout << first << " " << second << std::endl;
}
return 0;
}
produces an output
boost::range::combine(vec1, vec2).size() = 2
1 5
2 6
and fails while access over vec1.end()
- 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 38/100
-
Bad is_sorted docsOpen
Difficulty 1/5 Under an hour Newbie friendliness 55/100
-
Difficulty 3/5 1-2 days Newbie friendliness 45/100
Similar issues
-
bug iOS 🍎 ui/ux
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
MerginMaps/mobile#4744 ·
Maintainers usually reply within 1 day
-
Component: Ruby Type: bug
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 88/100
Maintainers usually reply within 3 days
-
Difficulty 1/5 Under an hour Newbie friendliness 92/100
kokkos/kokkos-kernels#3328 ·
Maintainers usually reply within 1 day
-
bug needs triage tcp
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
project-chip/connectedhomeip#74644 ·
Maintainers usually reply within 1 day