[all-commits] [llvm/llvm-project] ca7926: [libc++] Eliminate needless `add_lvalue_reference`...

Quuxplusone via All-commits all-commits at lists.llvm.org
Sun Aug 22 08:43:57 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: ca7926bd79426fbd8b752d6513c77951db35109f
      https://github.com/llvm/llvm-project/commit/ca7926bd79426fbd8b752d6513c77951db35109f
  Author: Arthur O'Dwyer <arthur.j.odwyer at gmail.com>
  Date:   2021-08-22 (Sun, 22 Aug 2021)

  Changed paths:
    M libcxx/include/__algorithm/comp_ref_type.h
    M libcxx/include/__algorithm/equal.h
    M libcxx/include/__algorithm/find_end.h
    M libcxx/include/__algorithm/is_permutation.h
    M libcxx/include/__algorithm/lower_bound.h
    M libcxx/include/__algorithm/partition.h
    M libcxx/include/__algorithm/remove_if.h
    M libcxx/include/__algorithm/search.h
    M libcxx/include/__algorithm/search_n.h
    M libcxx/include/__algorithm/sort.h
    M libcxx/include/__algorithm/stable_partition.h
    M libcxx/include/__algorithm/unique.h
    M libcxx/include/__algorithm/unique_copy.h
    M libcxx/include/__algorithm/upper_bound.h

  Log Message:
  -----------
  [libc++] Eliminate needless `add_lvalue_reference` from <algorithm> helpers. NFCI.

When `_Compare` is a function parameter already (so it's not `void`
and it's not an abominable function type), `add_lvalue_reference_t<_Compare>`
is simply a synonym for `_Compare&`. We don't need to pull in `<type_traits>`
and instantiate a template trait to figure that out.

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




More information about the All-commits mailing list