[libcxx-commits] [libcxx] [libcxx] patch for implementing ranges::find_last (PR #67270)
via libcxx-commits
libcxx-commits at lists.llvm.org
Thu Nov 2 00:18:50 PDT 2023
huixie90 wrote:
> > > I'd prefer it if we implemented `find_last` and `find_last_if` independently, instead of deferring to an implementation function.
> >
> >
> > Why?
>
> It simplifies the implementation so that we can directly call `x == y`, rather than having to go through `std::invoke`, which is currently opaque and bad for debug info.
I don’t think it simplifies the “implementation” of Libc++, but quite opposite, make it very complex. You can see the every optimisation overload is duplicated in this review. Even my code review comments to these optimisations are duplicated. I think you are effectively suggesting all library writers : duplicate code if you can because it release the burden of compiler optimisations and debugging tool. This just adds burden to library writers.
https://github.com/llvm/llvm-project/pull/67270
More information about the libcxx-commits
mailing list