[libcxx-commits] [PATCH] D60027: Add shift functions (P0769)

Zoe Carver via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Sun Mar 31 20:31:43 PDT 2019


zoecarver updated this revision to Diff 193038.
zoecarver edited the summary of this revision.
zoecarver added a comment.
Herald added a subscriber: jdoerfert.

**Update:**
I have re-implemented the shift algorithm. Now it uses a much more similar method to the example given in the paper.

Just so we are all on the same page, here is an example of what this patch does:

  T arr[] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 };
  auto b = std::begin(arr);
  auto e = std::end(arr);
  
  auto left = shift_left(b, e, 5); // left = 5,6,7,8,9
  auto right = shift_right(b, e, 5); // right = 0,1,2,3,4
  auto empty = shift_right(left, left + 10, 5); // empty = <empty>

Thank you @mclow.lists for the tests and help implementing.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D60027/new/

https://reviews.llvm.org/D60027

Files:
  include/algorithm
  test/std/algorithms/alg.shift/shift_exec_policy.pass.cpp
  test/std/algorithms/alg.shift/shift_left.pass.cpp
  test/std/algorithms/alg.shift/shift_right.pass.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D60027.193038.patch
Type: text/x-patch
Size: 15213 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libcxx-commits/attachments/20190401/889b9805/attachment.bin>


More information about the libcxx-commits mailing list