[all-commits] [llvm/llvm-project] 2c3bba: [libc++] Implement ranges::move{, _backward}

philnik777 via All-commits all-commits at lists.llvm.org
Thu Jun 23 04:53:20 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 2c3bbac0c7154cd6a286e0e05aa62308836a3655
      https://github.com/llvm/llvm-project/commit/2c3bbac0c7154cd6a286e0e05aa62308836a3655
  Author: Nikolas Klauser <nikolasklauser at berlin.de>
  Date:   2022-06-23 (Thu, 23 Jun 2022)

  Changed paths:
    M libcxx/include/CMakeLists.txt
    M libcxx/include/__algorithm/move.h
    A libcxx/include/__algorithm/ranges_move.h
    A libcxx/include/__algorithm/ranges_move_backward.h
    M libcxx/include/algorithm
    M libcxx/include/module.modulemap.in
    M libcxx/test/libcxx/private_headers.verify.cpp
    A libcxx/test/std/algorithms/alg.modifying.operations/alg.move/ranges.move.pass.cpp
    A libcxx/test/std/algorithms/alg.modifying.operations/alg.move/ranges.move_backward.pass.cpp
    M libcxx/test/std/library/description/conventions/customization.point.object/niebloid.compile.pass.cpp

  Log Message:
  -----------
  [libc++] Implement ranges::move{, _backward}

This patch also adds a new optimization to `std::move`. It unwraps three `reverse_iterator`s if the wrapped iterator is a `contiguous_iterator` and the iterated type is trivially_movable. This allows us to simplify `ranges::move_backward` to a forward to `std::move` without any pessimization.

Reviewed By: var-const, #libc

Spies: libcxx-commits, mgorny

Differential Revision: https://reviews.llvm.org/D126616




More information about the All-commits mailing list