Differential D102809 Diff 346561 libcxx/test/std/iterators/iterator.requirements/iterator.cust/unqualified_lookup_wrapper.h
Changeset View
Changeset View
Standalone View
Standalone View
libcxx/test/std/iterators/iterator.requirements/iterator.cust/unqualified_lookup_wrapper.h
Show First 20 Lines • Show All 51 Lines • ▼ Show 20 Lines | |||||
union some_union { | union some_union { | ||||
int x; | int x; | ||||
double y; | double y; | ||||
}; | }; | ||||
constexpr int iter_move(some_union& u) noexcept(false) { return u.x; } | constexpr int iter_move(some_union& u) noexcept(false) { return u.x; } | ||||
} // namespace check_unqualified_lookup | } // namespace check_unqualified_lookup | ||||
class move_tracker { | |||||
public: | |||||
move_tracker() = default; | |||||
constexpr move_tracker(move_tracker&& other) noexcept : moves_{other.moves_ + 1} { other.moves_ = 0; } | |||||
constexpr move_tracker& operator=(move_tracker&& other) noexcept { | |||||
moves_ = other.moves_ + 1; | |||||
other.moves_ = 0; | |||||
return *this; | |||||
} | |||||
Quuxplusone: ```
move_tracker(const move_tracker&) = delete;
move_tracker& operator=(const move_tracker&) =… | |||||
constexpr move_tracker(move_tracker const& other) = delete; | |||||
constexpr move_tracker& operator=(move_tracker const& other) = delete; | |||||
[[nodiscard]] constexpr int moves() const noexcept { return moves_; } | |||||
QuuxplusoneUnsubmitted int moves() const { return moves_; } :) Quuxplusone: `int moves() const { return moves_; }` :) | |||||
QuuxplusoneUnsubmitted moves() still doesn't need noexcept. Quuxplusone: `moves()` still doesn't need `noexcept`. | |||||
zoecarverAuthorUnsubmitted I think it makes sense to leave the constexpr in this case. This is a sort of general utility. zoecarver: I think it makes sense to leave the constexpr in this case. This is a sort of general utility. | |||||
private: | |||||
int moves_ = 0; | |||||
}; | |||||
#endif // LIBCPP_TEST_STD_ITERATOR_UNQUALIFIED_LOOKUP_WRAPPER | #endif // LIBCPP_TEST_STD_ITERATOR_UNQUALIFIED_LOOKUP_WRAPPER |
(Deleted functions don't need constexpr.)