[libcxx-commits] [PATCH] D60027: Add shift functions (P0769)
Zoe Carver via Phabricator via libcxx-commits
libcxx-commits at lists.llvm.org
Fri Mar 29 21:03:35 PDT 2019
zoecarver created this revision.
zoecarver added reviewers: mclow.lists, ldionne, howard.hinnant.
Herald added subscribers: libcxx-commits, dexonsmith.
Adds `shift_right` and `shift_left` functions to algorythems as specified in P0769R2 <http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0769r2.pdf>.
In this implementation, I use `std::advance` to shift the iterators instead of the proposed sample algorithm. This seems to work fine and be much faster, but there may be some reason not to do this which I am unaware of.
The document <http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0769r2.pdf> suggests that _only_ `shift_left` is a `constexpr` while all other functions/overloads are not. I think this is a typo, but I can update if needed.
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 5376 bytes
Desc: not available
More information about the libcxx-commits