Commit 08850701 by Martin Brænne Committed by Copybara-Service

Remove `CharIterator::operator->`.

An `operator->` that doesn't return a record type doesn't really serve a useful
purpose, and it is not required by the iterator concepts. I haven't been able
to find any usage in non-test code, so I'm removing it.

Even though the `pointer` type alias is now not being used anywhere, I'm keeping
it because otherwise some standard libraries don't accept `CharIterator` when
passed to `std::string::apend()`, for example.

PiperOrigin-RevId: 659832167
Change-Id: I5de183a01009bfd71c8477f2023973075be8d860
parent 00478de3
......@@ -641,7 +641,6 @@ class Cord {
bool operator==(const CharIterator& other) const;
bool operator!=(const CharIterator& other) const;
reference operator*() const;
pointer operator->() const;
friend Cord;
......@@ -1659,10 +1658,6 @@ inline Cord::CharIterator::reference Cord::CharIterator::operator*() const {
return *chunk_iterator_->data();
}
inline Cord::CharIterator::pointer Cord::CharIterator::operator->() const {
return chunk_iterator_->data();
}
inline Cord Cord::AdvanceAndRead(absl::Nonnull<CharIterator*> it,
size_t n_bytes) {
assert(it != nullptr);
......
......@@ -2530,8 +2530,6 @@ static void VerifyCharIterator(const absl::Cord& cord) {
EXPECT_EQ(*pre_iter, *post_iter);
EXPECT_EQ(&*pre_iter, &*post_iter);
EXPECT_EQ(&*pre_iter, pre_iter.operator->());
const char* character_address = &*pre_iter;
absl::Cord::CharIterator copy = pre_iter;
++copy;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment