Opened 6 years ago
Closed 6 years ago
#873 closed defect (fixed)
skip lvalue requirement in Distance concept
Reported by: | Peter | Owned by: | Peter |
---|---|---|---|
Priority: | critical | Milestone: | yat 0.14 |
Component: | utility | Version: | |
Keywords: | Cc: |
Description
This is a subticket of #803, but put here to highlight the difference.
In yat 0.13 Distance concept is documented to work with (const) std::forward_iterator
. In terms of boost iterator concepts that translates to
readable_iterator
forward_traversal
lvalue_iterator
where the last point means that operator*
returns T&
or const T&
, i.e., a proxy class cannot be returned. Therefore, Distance classes are not guaranteed to work with e.g. utility::WeightedIterator
. This is unwanted and only reason it exists is because we used more coarse-grained iterator concepts in std. I suggest we skip the lvalue
requirment on iterators so Distance functionality can work with iterators that return proxy classes as well.
Upside: Proxy iterators can be used with Distance functionality
Downside: If user has its own Distance class and requires lvalue semantic it will not compile against yat 0.14 if we implement the new concept check in functions/classes that take Distance (e.g. classifier::NCC
).
Change History (4)
comment:1 Changed 6 years ago by
comment:3 Changed 6 years ago by
Owner: | changed from Jari Häkkinen to Peter |
---|---|
Status: | new → assigned |
comment:4 Changed 6 years ago by
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
I forgot to say, this came about because requirements would be more intuitive if we could just say that Distance concept should work on a concept Data Iterator (with stricter requirement on the traversal).