Skip to content

Commit e1348ba

Browse files
Xiaoyang Liuyuxuanchen1997
authored andcommitted
[libc++][ranges] LWG3618: Unnecessary iter_move for transform_view::iterator (#91809)
Summary: ## Introduction This patch implements LWG3618: Unnecessary `iter_move` for `transform_view::iterator`. `transform_view`'s iterator currently specifies a customization point for `iter_move`. This customization point does the same thing that the default implementation would do, but its sole purpose is to ensure the appropriate conditional `noexcept` specification. ## Reference - [[range.transform.iterator]](https://eel.is/c++draft/range.transform.iterator) - [LWG3618](https://cplusplus.github.io/LWG/issue3618) Test Plan: Reviewers: Subscribers: Tasks: Tags: Differential Revision: https://phabricator.intern.facebook.com/D60251361
1 parent e61945c commit e1348ba

File tree

4 files changed

+2
-58
lines changed

4 files changed

+2
-58
lines changed

libcxx/docs/Status/Cxx23Issues.csv

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@
146146
"`3610 <https://wg21.link/LWG3610>`__","``iota_view::size`` sometimes rejects integer-class types","February 2022","","","|ranges|"
147147
"`3612 <https://wg21.link/LWG3612>`__","Inconsistent pointer alignment in ``std::format`` ","February 2022","|Complete|","14.0","|format|"
148148
"`3616 <https://wg21.link/LWG3616>`__","LWG 3498 seems to miss the non-member ``swap`` for ``basic_syncbuf`` ","February 2022","",""
149-
"`3618 <https://wg21.link/LWG3618>`__","Unnecessary ``iter_move`` for ``transform_view::iterator`` ","February 2022","","","|ranges|"
149+
"`3618 <https://wg21.link/LWG3618>`__","Unnecessary ``iter_move`` for ``transform_view::iterator`` ","February 2022","|Complete|","19.0","|ranges|"
150150
"`3619 <https://wg21.link/LWG3619>`__","Specification of ``vformat_to`` contains ill-formed ``formatted_size`` calls","February 2022","|Nothing to do|","","|format|"
151151
"`3621 <https://wg21.link/LWG3621>`__","Remove feature-test macro ``__cpp_lib_monadic_optional`` ","February 2022","|Complete|","15.0"
152152
"`3632 <https://wg21.link/LWG3632>`__","``unique_ptr`` ""Mandates: This constructor is not selected by class template argument deduction""","February 2022","|Nothing to do|",""

libcxx/include/__ranges/transform_view.h

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -326,13 +326,6 @@ class transform_view<_View, _Fn>::__iterator : public __transform_view_iterator_
326326
{
327327
return __x.__current_ - __y.__current_;
328328
}
329-
330-
_LIBCPP_HIDE_FROM_ABI friend constexpr decltype(auto) iter_move(const __iterator& __i) noexcept(noexcept(*__i)) {
331-
if constexpr (is_lvalue_reference_v<decltype(*__i)>)
332-
return std::move(*__i);
333-
else
334-
return *__i;
335-
}
336329
};
337330

338331
# if _LIBCPP_STD_VER >= 23

libcxx/test/std/ranges/range.adaptors/range.transform/iterator/deref.pass.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ int main(int, char**) {
3737
using View = std::ranges::transform_view<MoveOnlyView, PlusOneNoexcept>;
3838
View transformView(MoveOnlyView{buff}, PlusOneNoexcept{});
3939
assert(*transformView.begin() == 1);
40-
LIBCPP_ASSERT_NOEXCEPT(*std::declval<std::ranges::iterator_t<View>>());
40+
ASSERT_NOEXCEPT(*std::declval<std::ranges::iterator_t<View>>());
4141
ASSERT_SAME_TYPE(int, decltype(*std::declval<View>().begin()));
4242
}
4343
{

libcxx/test/std/ranges/range.adaptors/range.transform/iterator/iter_move.pass.cpp

Lines changed: 0 additions & 49 deletions
This file was deleted.

0 commit comments

Comments
 (0)