Skip to content

Commit

Permalink
Tiny semantic fix in RepeatedPtrOverPtrsIterator (NFC)
Browse files Browse the repository at this point in the history
The original code worked in practice only because the pointed-to type is always `void`, and `void**` is convertible to `void*` (ignoring constness).

PiperOrigin-RevId: 719003773
  • Loading branch information
protobuf-github-bot authored and copybara-github committed Jan 23, 2025
1 parent 7878682 commit 565fada
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/google/protobuf/repeated_ptr_field.h
Original file line number Diff line number Diff line change
Expand Up @@ -1736,7 +1736,7 @@ class RepeatedPtrOverPtrsIterator {
typename OtherElement, typename OtherVoidPtr,
typename std::enable_if<
std::is_convertible<OtherElement*, pointer>::value &&
std::is_convertible<OtherVoidPtr*, VoidPtr>::value>::type* = nullptr>
std::is_convertible<OtherVoidPtr, VoidPtr>::value>::type* = nullptr>
RepeatedPtrOverPtrsIterator(
const RepeatedPtrOverPtrsIterator<OtherElement, OtherVoidPtr>& other)
: it_(other.it_) {}
Expand Down

0 comments on commit 565fada

Please sign in to comment.