-
Notifications
You must be signed in to change notification settings - Fork 15.1k
Open
Labels
libc++libc++ C++ Standard Library. Not GNU libstdc++. Not libc++abi.libc++ C++ Standard Library. Not GNU libstdc++. Not libc++abi.
Description
Replace lvalue references with forwarding references for predicates and projections in algorithms helpers.
This point has been raised a couple of times in reviews:
- [libc++] Forward more algorithms to the classic algorithmsย #114674 (comment)
- [libc++] Optimizing is_permutationย #129565 (comment)
Few helper functions already do this:
llvm-project/libcxx/include/__algorithm/is_permutation.h
Lines 73 to 80 in 96925fa
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 bool __is_permutation_impl( _Iter1 __first1, _Sent1 __last1, _Iter2 __first2, _Sent2 __last2, _Pred&& __pred, _Proj1&& __proj1, _Proj2&& __proj2) { __partition_fn_impl(_Iter&& __first, _Sent&& __last, _Pred&& __pred, _Proj&& __proj) {
ldionne
Metadata
Metadata
Assignees
Labels
libc++libc++ C++ Standard Library. Not GNU libstdc++. Not libc++abi.libc++ C++ Standard Library. Not GNU libstdc++. Not libc++abi.