Skip to content

Instantly share code, notes, and snippets.

@gonidelis
Created July 30, 2020 20:13
Show Gist options
  • Save gonidelis/2c838d00533bd9066184961f158d3516 to your computer and use it in GitHub Desktop.
Save gonidelis/2c838d00533bd9066184961f158d3516 to your computer and use it in GitHub Desktop.
adapted transform loop
namespace detail {
template <typename Iter>
struct transform_loop
{
template <typename InIterB, typename InIterE, typename OutIter, typename F>
HPX_HOST_DEVICE HPX_FORCEINLINE static util::in_out_result<InIterB, OutIter>
call(InIterB first, InIterE last, OutIter dest, F&& f)
{
for (/* */; first != last; (void) ++first, ++dest)
{
*dest = hpx::util::invoke(std::forward<F>(f), first);
}
return util::in_out_result<InIterB, OutIter>(std::move(first), std::move(dest));
}
};
} // namespace detail
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment