[libcxx-commits] [PATCH] D128744: [libc++][ranges] Implement `ranges::partial_sort`.

Hui via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Wed Jul 6 02:41:15 PDT 2022


huixie90 accepted this revision.
huixie90 added inline comments.


================
Comment at: libcxx/include/__algorithm/sift_down.h:42
 
     if ((__child + 1) < __len && __comp(*__child_i, *(__child_i + difference_type(1)))) {
         // right-child exists and is greater than left-child
----------------
var-const wrote:
> huixie90 wrote:
> > I had a look at the implementation of `_make_projected_comp`, if the new range's algorithm caller pass in a member function pointer and `std::identity` as projection, this `__comp` would be kept as a member function pointer and fail to compile here calling `operator()`
> > 
> > is there any tests covering this case?
> This is a great catch, thanks! Do you plan to fix this in D129099 (since that patch already contains an overload of `__make_projected_comp` that avoids the issue)?
I updated D129099 to fix the first overload. could you please double check if that is OK?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D128744



More information about the libcxx-commits mailing list