#9684 closed Patches (invalid)
Add a multidimensional counting_range
Reported by: | Owned by: | Neil Groves | |
---|---|---|---|
Milestone: | To Be Determined | Component: | range |
Version: | Boost 1.55.0 | Severity: | Not Applicable |
Keywords: | multidimensional counting_range | Cc: |
Description
I think a multidimensional (floating point) counting_range with configurable step size would be useful, at least I have found a need for that many times. Here is a suggestion, could something like this eventually be included in boost? What modifications should I make (after switching to boost::bind)? The iterated values are evenly spaced from each other and the boundaries.
Example usage:
boost::array<double, 2> start{-4, 3}, end{4, 11};
const size_t samples_per_dim = 2;
for (const auto& i: volume_iterator(start, end, samples_per_dim)) {
print(i);
}
Output:
-2 5
2 5
-2 9
2 9
Attachments (1)
Change History (4)
by , 9 years ago
comment:1 by , 9 years ago
Resolution: | → invalid |
---|---|
Status: | new → closed |
comment:2 by , 9 years ago
In case someone finds this useful I've put it into a hpp file here: ttps://github.com/nasailja/pamhd/blob/master/source/volume_range.hpp
comment:3 by , 9 years ago
Couldn't get past the spam filter, the correct address starts with https...
irange with step size already exists. The floating-point idea has been explicitly rejected due to difficulties providing loop variant / invariant guarantees.