[libcxx-commits] [libcxx] [libc++][NFC] Simplify copy and move lowering to memmove a bit (PR #83574)

Louis Dionne via libcxx-commits libcxx-commits at lists.llvm.org
Tue Mar 19 22:29:17 PDT 2024


================
@@ -117,20 +104,8 @@ template <class _Algorithm,
           class _OutIter,
           __enable_if_t<!__can_rewrap<_InIter, _Sent, _OutIter>::value, int> = 0>
 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX17 pair<_InIter, _OutIter>
-__unwrap_and_dispatch(_InIter __first, _Sent __last, _OutIter __out_first) {
-  return _Algorithm()(std::move(__first), std::move(__last), std::move(__out_first));
-}
-
-template <class _AlgPolicy,
-          class _NaiveAlgorithm,
-          class _OptimizedAlgorithm,
-          class _InIter,
-          class _Sent,
-          class _OutIter>
-_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX17 pair<_InIter, _OutIter>
 __dispatch_copy_or_move(_InIter __first, _Sent __last, _OutIter __out_first) {
----------------
ldionne wrote:

I've looked at this patch a couple of times and I don't fully understand it, despite its apparent simplicity.

Why is this called `__dispatch_copy_or_move`? It seems to me that this doesn't actually perform any dispatching, right?

https://github.com/llvm/llvm-project/pull/83574


More information about the libcxx-commits mailing list