Skip to content

Commit

Permalink
Added TransfPartial::operator()
Browse files Browse the repository at this point in the history
  • Loading branch information
OleErikPeistorpet committed Sep 30, 2023
1 parent 5a9d89f commit de7900d
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion view/transform.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ struct _transformFn
return static_cast<Range &&>(r) | (*this)(std::move(f));
}
};
/** @brief Similar to std::views::transform
/** @brief Similar to std::views::transform, same call signature
*
* Unlike std::views::transform, copies or moves the function into the iterator rather than
* storing it just in the view, thus saving one indirection when dereferencing the iterator.
Expand Down Expand Up @@ -96,6 +96,12 @@ namespace _detail
{
return _transformView{view::all( static_cast<Range &&>(r) ), std::move(t)._f};
}

template< typename Range >
constexpr auto operator()(Range && r) const
{
return static_cast<Range &&>(r) | *this;
}
};
}

Expand Down

0 comments on commit de7900d

Please sign in to comment.