[libc++] Make `_IterOps::__iter_move` more similar to `std::ranges::iter_move`.
authorKonstantin Varlamov <varconst@apple.com>
Thu, 28 Jul 2022 09:06:44 +0000 (02:06 -0700)
committerKonstantin Varlamov <varconst@apple.com>
Thu, 28 Jul 2022 09:06:57 +0000 (02:06 -0700)
commitb3afea1ce0bd3c9293edae67c1839318eecdd7bf
treed6ead9af09d4985690cd541b1c5d37015f0bb20e
parent8daa338297d533db4d1ae8d3770613eb25c29688
[libc++] Make `_IterOps::__iter_move` more similar to `std::ranges::iter_move`.

Avoid relying on `iterator_traits` and instead deduce the return type of
dereferencing the iterator. Additionally, add a static check to reject
iterators with incorrect `iterator_traits` at compile time.

Differential Revision: https://reviews.llvm.org/D130538
libcxx/include/__algorithm/iterator_operations.h
libcxx/test/libcxx/algorithms/bad_iterator_traits.verify.cpp [new file with mode: 0644]