-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement LWG-3785 ranges::to
is over-constrained on the destination type being a range
#3319
Conversation
@@ -7668,7 +7668,8 @@ namespace ranges { | |||
// clang-format on | |||
|
|||
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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...