[libcxx-commits] [PATCH] D60027: Add shift functions (P0769)
Zoe Carver via Phabricator via libcxx-commits
libcxx-commits at lists.llvm.org
Mon Aug 5 19:59:37 PDT 2019
zoecarver marked an inline comment as done.
zoecarver added inline comments.
================
Comment at: libcxx/include/algorithm:5734
+_LIBCPP_CONSTEXPR_AFTER_CXX14 _It
+shift_right(_It __first, _It __last, typename iterator_traits<_It>::difference_type __n)
+{
----------------
ldionne wrote:
> We're making multiple passes over the whole range to get things like `__rbegin`. I can't imagine that's the only way of implementing this algorithm, and if so, that was certainly not the intent of the paper.
>
> Did you look at https://github.com/danra/shift_proposal/blob/master/shift_proposal.h?
I try not to look at the sample implementations, it's more fun that way :) In this case, the implementation is much more performant, so I will implement it (or something close).
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D60027/new/
https://reviews.llvm.org/D60027
More information about the libcxx-commits
mailing list