Re: [hub] on the specialized iteration over elements
Alexander Grund via Boost <[email protected]>
| Newsgroups | gmane.comp.lib.boost.devel |
|---|---|
| Message-ID | <[email protected]> |
Am 17.04.26 um 09:51 schrieb Joaquin M López Muñoz via Boost: > El 17/04/2026 a las 0:23, Jean-Louis Leroy via Boost escribió: >>> Third, the interface is rather unusual, and it allows one hub to >>> iterate >>> over another hub's elements: >>> >>> hub<T> h, g; >>> h.visit(g.begin(), g.end(), fun); >> I guess it can be useful to iterate over a narrower range. But in >> that spirit, I would expect 'visit' to return the "end" iterator. > > To be quite honest, I don't see tremendous value on iterating over a > range narrower than the whole container, because insertion order in > hub is arbitrary and there's no meaningul property that elements of a > subrange would share --same rationale applies to other unordered > containers like, for instance, std::unordered_map. The function > visit(first, last, f) is there for operational closure reasons, so to > say. If your functor could break out of iteration, like Ions suggested visit_while it could make sense to be able to "resume" iteration where it left off _______________________________________________ Boost mailing list -- [email protected] To unsubscribe send an email to [email protected] https://lists.boost.org/mailman3/lists/boost.lists.boost.org/ Archived at: https://lists.boost.org/archives/list/[email protected]/message/J574EEAGP5E3IQMZRXHCCCGY27KIAK3N/
smime.p7s
(application/pkcs7-signature, 4.7 KB) - not displayed