Implement LWG-3785 ranges::to is over-constrained on the destination type being a range#3319
Conversation
| template <class _Rng, class _Container> | ||
| concept _Ref_converts = convertible_to<range_reference_t<_Rng>, range_value_t<_Container>>; | ||
| concept _Ref_converts = | ||
| (!input_range<_Container>) || convertible_to<range_reference_t<_Rng>, range_value_t<_Container>>; |
There was a problem hiding this comment.
For other reviewers: these parentheses are needed only to avoid clang-format damage.
cc @brevzin |
Somebody would need to propose a new And yeah, we should add that constructor (but... not in this PR of course). |
|
I'm mirroring this to the MSVC-internal repo - please notify me if any further changes are pushed. |
|
Thanks for changing the STL to be more conformant and useful! 😹 🤪 🚀 |
Fixes #3227.
I failed to figure out how to "convert a range of
expected<T, E>toexpected<vector<T>, E>" withranges::to, so I just added some trivial test cases...