[libcxx-commits] [PATCH] D130538: [libc++] Make `_IterOps::__iter_move` more similar to `std::ranges::iter_move`.
Hui via Phabricator via libcxx-commits
libcxx-commits at lists.llvm.org
Wed Jul 27 12:25:37 PDT 2022
huixie90 accepted this revision.
huixie90 added inline comments.
================
Comment at: libcxx/include/__algorithm/iterator_operations.h:85-86
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX11 static
+ // Declaring the return type is necessary for C++03.
+ // If the result of dereferencing `_Iter` is a reference type, deduce the result of calling `std::move` on it.
+ __enable_if_t<
----------------
nit: i think the comments no long apply anymore. The return type also has sfinae logic in it
================
Comment at: libcxx/include/__algorithm/iterator_operations.h:93
+
return std::move(*std::forward<_Iter>(__i));
}
----------------
extra nit: perhaps we don't need to forward it, because the `__deref_t` and `_move_t` are defined in terms of lvalue of `_Iter`
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D130538/new/
https://reviews.llvm.org/D130538
More information about the libcxx-commits
mailing list