Opened 15 years ago
Closed 14 years ago
#1296 closed Patches (wontfix)
std::advance and std::distance for Boost.Iterator traversal categories
Reported by: | anonymous | Owned by: | Dave Abrahams |
---|---|---|---|
Milestone: | To Be Determined | Component: | iterator |
Version: | Boost Development Trunk | Severity: | Problem |
Keywords: | Cc: | Thomas Witt |
Description
The new traversal categories of Boost.Iterator should be used in std::advance and std::distance, but this is obviously not possible without the cooperation of compiler writers.
The attached patch (against the trunk, rev. 39675) implements boost::advance and boost::distance that use the new iterator categories. It implements them within the utility library, since that library already contains the closely related next() and prior() function templates. Documentation and test cases are included.
The patch also modifies next() and prior() to use boost::advance(), although this change is a considerably higher risk than the addition of the new feature.
Change History (2)
comment:1 by , 15 years ago
Component: | None → iterator |
---|---|
Owner: | set to |
comment:2 by , 14 years ago
Cc: | added |
---|---|
Resolution: | → wontfix |
Status: | new → closed |
Aside from the fact that this is not a patch for the iterator library, the new categories are a dead-end as the standard has lifted the reference requirement on forward iterators, so I don't plan to implement anything like this. I actually plan to deprecate the new categories.