Hello, Can we use an iterator after deletion of a parent object? For example, like this;> Xapian::Document* doc = new Xapian::Document(other_doc); > TermIterator iter = doc->termlist_begin(); > delete doc; > iter++; >-- Best regards, Uvarov Michael -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.xapian.org/pipermail/xapian-devel/attachments/20120516/5a39c150/attachment.htm>
On Wed, May 16, 2012 at 02:44:18PM +0400, Michael Uvarov wrote:> Can we use an iterator after deletion of a parent object? > > For example, like this; > > > Xapian::Document* doc = new Xapian::Document(other_doc); > > TermIterator iter = doc->termlist_begin(); > > delete doc; > > iter++;Yes, iter will internally keep a reference to doc. Cheers, Olly