Details
- Reviewers
ldionne - Group Reviewers
Restricted Project - Commits
- rG37e5baf318b1: [libc++][PSTL] Implement std::sort
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
libcxx/include/__algorithm/pstl_sort.h | ||
---|---|---|
32–38 | This way of defining the "two overloads" (the one with and the one without a comp) will accept the following code, which shouldn't be valid: std::sort(policy, it1, it2, {}); Instead, let's do like we do in the serial std::sort and have two separate overloads (and make the no-comp overload simply call the comp overload with std::less<>()). Let's also add a SFINAE test to ensure that we don't accept that code (and while we're at it let's add one to the serial std::sort if we don't have one already). | |
41–42 | Is there any reason we're not std::moveing the arguments like __g_comp into std::stable_sort? The same observation probably applies to all the other algorithms we have so far. | |
libcxx/test/std/algorithms/alg.sorting/alg.sort/sort/pstl.sort.pass.cpp | ||
37 | I don't think you have any tests for the algorithm with a custom comparator. | |
libcxx/test/support/test_macros.h | ||
278 | Let's move this closer to line 366 where we define the other similar macros. |
This way of defining the "two overloads" (the one with and the one without a comp) will accept the following code, which shouldn't be valid:
Instead, let's do like we do in the serial std::sort and have two separate overloads (and make the no-comp overload simply call the comp overload with std::less<>()).
Let's also add a SFINAE test to ensure that we don't accept that code (and while we're at it let's add one to the serial std::sort if we don't have one already).