[libcxx-commits] [PATCH] D93661: [libc++] [P0879] constexpr std::sort, and add new tests for it

Arthur O'Dwyer via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Thu Jan 28 09:49:09 PST 2021


Quuxplusone marked an inline comment as done.
Quuxplusone added inline comments.


================
Comment at: libcxx/include/algorithm:5502
+void
+sort(__wrap_iter<_Tp*> __first, __wrap_iter<_Tp*> __last, _Compare __comp)
+{
----------------
ldionne wrote:
> In a second step, couldn't we remove this overload to replace it by calls to `__unwrap_iter`?
As of current main, no, because `__unwrap_iter` isn't optimized for non-trivially-copyable element types (it unwraps `__wrap_iter<int*>` but not `__wrap_iter<string*>`). If we land D94807 first, then yes.

I suppose this implies that I should make D94807 a parent of this one and prioritize it. I think I agree that that would be a much nicer overall solution than the current soup of overload sets.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D93661



More information about the libcxx-commits mailing list