Skip to content

Commit

Permalink
minor update to code
Browse files Browse the repository at this point in the history
  • Loading branch information
huixie90 committed Jun 9, 2023
1 parent e767c3c commit 98f5fba
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions impl/concat/concat.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -302,6 +302,7 @@ class concat_view : public view_interface<concat_view<Views...>> {
if constexpr (N == sizeof...(Views) - 1) {
get<N>(it_) += static_cast<underlying_diff_type>(steps);
} else {
static_assert(std::ranges::sized_range<decltype(get<N>(parent_->views_))>);
auto n_size = ranges::distance(get<N>(parent_->views_));
if (current_offset + steps < static_cast<difference_type>(n_size)) {
get<N>(it_) += static_cast<underlying_diff_type>(steps);
Expand All @@ -323,6 +324,7 @@ class concat_view : public view_interface<concat_view<Views...>> {
if (current_offset >= steps) {
get<N>(it_) -= static_cast<underlying_diff_type>(steps);
} else {
static_assert(std::ranges::sized_range<decltype(get<N - 1>(parent_->views_))>);
auto prev_size = ranges::distance(get<N - 1>(parent_->views_));
it_.template emplace<N - 1>(ranges::begin(get<N - 1>(parent_->views_)) +
prev_size);
Expand Down Expand Up @@ -568,7 +570,8 @@ class concat_view : public view_interface<concat_view<Views...>> {
common_reference_t<range_rvalue_reference_t<
__maybe_const<Const, Views>>...>>)&&...)) {
return std::visit(
[](auto const& i) -> xo::concat_rvalue_reference_t<__maybe_const<Const, Views>...> { //
[](auto const& i)
-> xo::concat_rvalue_reference_t<__maybe_const<Const, Views>...> { //
return ranges::iter_move(i);
},
ii.it_);
Expand All @@ -578,7 +581,7 @@ class concat_view : public view_interface<concat_view<Views...>> {
requires(indirectly_swappable<iterator_t<__maybe_const<Const, Views>>> && ... &&
swappable_with<xo::concat_reference_t<__maybe_const<Const, Views>...>,
xo::concat_reference_t<__maybe_const<Const, Views>...>>)
// todo: noexcept?
// todo: noexcept?
{
std::visit(
[&](const auto& it1, const auto& it2) {
Expand Down

0 comments on commit 98f5fba

Please sign in to comment.