Replies: 3 comments 2 replies
-
I like your proposal and I would like to move towards that direction. |
Beta Was this translation helpful? Give feedback.
-
The problem with this proposal is that Boost.Geometry supports iterators returning non-true/proxy references. Boost.Iterator concepts are used for that where std iterator category is replaced with boost traversal and access categories. This plays well with Boost.Range since e.g. random access range is defined in terms of iterator traversal category. This is not the case for standard ranges. Technically an iterator returning non-true/proxy reference even if its traversal category is random access is legacy input iterator because legacy forward iterator and upwards is required to return true reference. So technically AFAIU we'd have to require C++20 to be sure that the standard supports iterators/ranges that we allow. That said, AFAIU I'd also think about dropping Boost.Iterator dependency but I don't know how trivial that would be because as I said above an iterator could have random access traversal category, readable access category and std input iterator category at the same time. |
Beta Was this translation helpful? Give feedback.
-
Furthermore if we decided to stop using Boost.Range directly we wouldn't be able to drop this dependency because other libraries that we use depend on it, i.e. Algorithm, LexicalCast and by extension Math and Multiprecision. If we add Iterator into the mix then by extension Tokenizer. |
Beta Was this translation helpful? Give feedback.
-
In the discussion for #1129 I noticed reverts for range-based for loops and
std::begin
,std::end
. I understand that those are not strictly guaranteed to work under the concept requirements of Boost.Geometry (requiring applicable geometries to model Boost.Range Random Access Ranges), since a geometry could be implemented as a range in a way that is compatible with Boost.Range but not with the standard's notion of ranges.Since version 1.75, BG requires compilation with C++11 and C++14 support which brings language and standard library facilities that are similar to what Boost.Range provides and more convenient in some cases. Range functionalities have been further formalized and extended since. I propose changing the BG concept requirements that require Boost.Range Random Access Ranges to instead require ranges that conform to the standards notion of range-expressions (https://eel.is/c++draft/stmt.ranged#1.3), i.e. (IIUC) it is an array or it has
t.begin()
andt.end()
members orbegin(t)
andend(t)
can be found via ADL and those return random access iterators. (There's also the more formal std::ranges::range concept but that was only introduced C++20, although compilation support would not be required to refer to it in documentation.)Rationale:
Problems:
t.begin()
/t.end()
members or free functions namedbegin(t)
,end(t)
that can be found via ADL.Beta Was this translation helpful? Give feedback.
All reactions