Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Added tests for move_sentinel. Still missing: tests for the iterator_traits of move_iterator; tests for three-way comparison; tests for iter_move and iter_swap.
libcxx/include/__iterator/move_iterator.h | ||
---|---|---|
194 | I found that writing the naïve requires requires { __x.base() == __y.base(); } here did not work; Clang complains something about accessing into incomplete type move_iterator<X> when you go to instantiate it. Pulling the constraint out into a concept outside the body of the class seems to fix the issue. |
Rebase, add more tests for comparison operators.
Could still use more tests for
- iterator_traits
- iter_move
- iter_swap
But I think this is pretty much ready to have people start hammering on it.
libcxx/include/__iterator/move_iterator.h | ||
---|---|---|
145 | s/_LIBCPP_CONSTEXPR_AFTER_CXX14/constexpr here and below since we're already guarded with #if _LIBCPP_STD_VER > 17. | |
194 | I'll buy that. I've also run into this several times in other codebases with requires requires expressions in member functions of a class template. It's not great, but the usual "pull it out to a named concept" works. |
Rebase, coalesce some repeated ifdefs, use unadorned constexpr in C++20-only codepaths
This LGTM -- I think we can add a few more tests post-commit, but this looks reasonable as-is too. I'll rebase and ship this.
s/_LIBCPP_CONSTEXPR_AFTER_CXX14/constexpr here and below since we're already guarded with #if _LIBCPP_STD_VER > 17.