[Xapian-devel] Iterators

Olly Betts olly at survex.com
Wed May 16 12:44:03 BST 2012


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



More information about the Xapian-devel mailing list