-
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
Conditionally Borrowed Ranges #1877
Conditionally Borrowed Ranges #1877
Conversation
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.
Looks good to me!
Did you verify that we actually test against a borrowed range?
I don't have a deep understanding of the ranges test stuff, but implementing this forced me to fix the common view test, so it seems we do. |
As long as we use a span, we should be fine |
We need to add borrowed range support via a span to take_view and drop_view the other already test it Something along those lines should do it // Validate a non-view borrowed range
{
constexpr span s{some_ints};
STATIC_ASSERT(test_one(s, expected_output));
test_one(s, expected_output);
}
{ // Validate a view borrowed range
constexpr auto v =
views::iota(0ull, ranges::size(some_ints)) | std::views::transform([](auto i) { return some_ints[i]; });
STATIC_ASSERT(test_one(v));
test_one(v);
} |
.... and add coverage of member `data`.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Thanks for implementing this LWG issue resolution! 🚀 😻 🎉 |
Fixes #1682.