Skip to content
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

Fix ranges::to for rvalue ranges #55

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions core/include/gap/core/ranges.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,12 @@
template< typename container_t, std::ranges::input_range R >
void move_or_copy_elements(R&& rng, container_t& container) {
if constexpr (std::is_rvalue_reference_v< decltype(rng) >) {
std::move(std::ranges::begin(rng), std::ranges::end(rng),
std::back_inserter(container)
std::ranges::move(

Check failure on line 52 in core/include/gap/core/ranges.hpp

View workflow job for this annotation

GitHub Actions / build

‘move’ is not a member of ‘std::ranges’; did you mean ‘std::move’?

Check failure on line 52 in core/include/gap/core/ranges.hpp

View workflow job for this annotation

GitHub Actions / build

‘move’ is not a member of ‘std::ranges’; did you mean ‘std::move’?
std::ranges::begin(rng), std::ranges::end(rng), std::back_inserter(container)
);
} else {
std::copy(std::ranges::begin(rng), std::ranges::end(rng),
std::back_inserter(container)
std::ranges::copy(

Check failure on line 56 in core/include/gap/core/ranges.hpp

View workflow job for this annotation

GitHub Actions / build

‘copy’ is not a member of ‘std::ranges’; did you mean ‘std::copy’?

Check failure on line 56 in core/include/gap/core/ranges.hpp

View workflow job for this annotation

GitHub Actions / build

‘copy’ is not a member of ‘std::ranges’; did you mean ‘std::copy’?
std::ranges::begin(rng), std::ranges::end(rng), std::back_inserter(container)
);
}
}
Expand All @@ -69,7 +69,7 @@
result_container_t container;

if constexpr (has_reserve< result_container_t >) {
if constexpr (requires { std::ranges::size(range); }) {
if constexpr (std::ranges::sized_range<R>) {
container.reserve(std::ranges::size(range));
}
}
Expand Down
Loading