#12767 closed Feature Requests (fixed)
Make value-initialized iterators of intrusive containers comparable
Reported by: | Owned by: | Ion Gaztañaga | |
---|---|---|---|
Milestone: | To Be Determined | Component: | intrusive |
Version: | Boost 1.63.0 | Severity: | Problem |
Keywords: | Cc: | fdegros@… |
Description
Can value-initialized iterators of intrusive containers be compared?
For example, is the following code valid and well-defined?
using MyList = boost::intrusive::list<MyNode>; using It = MyList::iterator; It a = It(); It b = It(); assert(a == b);
This property is useful when it comes to returning empty ranges without having to create a dummy empty container.
If intrusive containers already support this property, then it would be good to explicitly mention it in the documentation. If not, I would like to add it as a feature request.
Note:
See TracTickets
for help on using tickets.
Thanks for the ticket. Boost.Intrusive supports comparison of value-initialized iterators. Documentation was missing, so I've done the following commit:
https://github.com/boostorg/intrusive/commit/47c8a19cfded4e31d03cd758a8663389d837b8be