Make it possible to construct collections from ranges of handles#923
Make it possible to construct collections from ranges of handles#923tmadlener merged 13 commits intoAIDASoft:masterfrom
Conversation
173c1dd to
d617722
Compare
m-fila
left a comment
There was a problem hiding this comment.
If we go this way then (later) we might also want to add customization point for std::ranges::to from C++23 to work with collections. Since collections are ranges, then std::ranges::to should look either for constructor taking range or constructor with std::from_range_t (disambiguation) and then range. I'd be against going with just range, since it's too easy to use by mistake especially there that subtlety subset/mutability (and we already delete copy constructor). But the constructor with std::from_range_t should be fine.
d617722 to
5a0cd7c
Compare
Good point. I agree with not having a constructor simply taking a range. Should we already now add that constructor and hide it behind |
Yes, let's do that |
8a9d5ec to
5d7161f
Compare
|
Added the constructors with the |
|
I'm sorry I haven't really had a chance to engage with this PR in the past weeks. Looks good though, but haven't tested. |
Add necessary utitlities to have an easy to_vector conversion from the range
Avoid potentially subtle conversion bugs that could be triggered otherwise
Co-authored-by: Mateusz Jakub Fila <37295697+m-fila@users.noreply.github.com>
Co-authored-by: Mateusz Jakub Fila <37295697+m-fila@users.noreply.github.com>
719231b to
fc11e96
Compare
BEGINRELEASENOTES
fromfactory function to create collections from ranges of (mutable or immutable) handlesENDRELEASENOTES
See discussion in #778 for some motivation of this.
@wdconinc this is a first attempt at addressing at least part of the issue discussed in #778. It allows to construct collections from ranges (satisfying
std::input_range) of handles, e.g.given that our collections also model a
std::input_range, it's also possible to construct from them using this approach.Open questions currently are:
invalid_argumentexception. Is this a problem?