OK, rephrase that question. Say you have a releated field containing
10 items. You wish to delete the 2nd item so that the list contains 9
items and foo_size() returns 9. Is that possible?
I can't see an erase() function in mutable_foo(), and I can't see
anything in RepeatedField that decrements current_size_ other than
RemoveLast() which presumably will only remove the _last_ item?
Currently the only way to remove elements from a list seems to be
awful hacks like a.parse(a.serialise()) after clearing the items you
want to delete
On Aug 12, 9:05 pm, "Kenton Varda" <
ken...@google.com> wrote:
> For C++, use the RepeatedField interfaces:
http://code.google.com/apis/protocolbuffers/docs/reference/cpp/google...
>
> You can get a mutable pointer to a RepeatedField or RepeatedPtrField that
> represents a field named "foo" by calling the message's "mutable_foo()"
> accessor.
>
> For Python, I think you currently have to clear the field and repopulate it.
>