1
      0
 *j    ator_category;
	    init(op_, window, begin, end, iterator_category());
	    bool positional = (op_ == OP_NEAR || op_ == OP_PHRASE);
	    for (I i = begin; i != end; ++i) {
		add_subquery(positional, *i);
	    }
	    done();
	}
    }

#ifdef SWIG
    // SWIG's %template doesn't seem to handle a templated ctor so we
    // provide this fake specialised form of the above prototype.
    Query(op op_, XapianSWIGQueryItor qbegin, XapianSWIGQueryItor qend,
	  Xapian::termcount parameter = 0);

# ifdef SWIGJAVA
    Query(op op_, XapianSWIGStrItor qbegin, XapianSWIGStrItor qend,
	  Xapian::termcount parameter = 0);
# endif
#endif

    /** Begin iterator for terms in the query object.
     *
     *  The iterator returns terms in ascending query position order, and
     *  will return the same term in each unique position it occurs in.
     *  If you want the terms in sorted order and without duplicates, see
     *  get_unique_terms_begin().
     */
    const TermIterator get_terms_begin() const;

    /// End iterator for terms in the query object.
    const TermIterator XAPIAN_NOTHROW(get_terms_end() const) {
	return TermIterator();
    }

    /** Begin iterator for unique terms in the query object.
     *
     *  Terms are sorted and terms with the same name removed from the list.
     *
     *  If you want the terms in ascending query position order, see
     *  get_terms_begin().
     */
    const TermIterator get_unique_terms_begin() const;

    /// End iterator for unique terms in the query object.
    const TermIterator XAPIAN_NOTHROW(get_unique_terms_end() const) {
	return TermIterator();
    }

    /** Return the length of this query object. */
    Xapian::termcount XAPIAN_NOTHROW(get_length() const) XAPIAN_PURE_FUNCTION;

    /** Check if this query is Xapian::Query::MatchNothing. */
    bool XAPIAN_NOTHROW(empty() const) {
	return internal.get() == 0;
    }

    /** Serialise this object into a string. */
    std::string serialise() const;

    /** Unserialise a string and return a Query object.
     *
     *  @param serialised	the string to unserialise.
     *  @param reg		Xapian::Registry object to use to unserialise
     *				user-subclasses of Xapian::PostingSource
     *				(default: standard registry).
     */
    static const Query unserialise(const std::string & serialised,
				   const Registry & reg = Registry());

    /** Get the type of the top level of the query. */
    op XAPIAN_NOTHROW(get_type() const) XAPIAN_PURE_FUNCTION;

    /** Get the number of subqueries of the top level query. */
    size_t XAPIAN_NOTHROW(get_num_subqueries() const) XAPIAN_PURE_FUNCTION;

    /** Read a top level subquery.
      *
      * @param n  Return the n-th subquery (starting from 0) - only valid when
      *		  0 <= n < get_num_subqueries().
      */
    const Query get_subquery(size_t n) const;

    /// Return a string describing this object.
    std::string get_description() const;

    /** Combine with another Xapian::Query object using OP_AND.
     *
     *  @since Since Xapian 1.4.10, when called on a Query object which is
     *  OP_AND and has a reference count of 1, then @a o is appended as a new
     *  subquery (provided @a o is a different Query object and
     *  <code>!o.empty()</code>).
     */
    const Query operator&=(const Query & o);

    /** Combine with another Xapian::Query object using OP_OR.
     *
     *  @since Since Xapian 1.4.10, when called on a Query object which is
     *  OP_OR and has a reference count of 1, then @a o is appended as a new
     *  subquery (provided @a o is a different Query object and
     *  <code>!o.empty()</code>).
     */
    const Query operator|=(const Query & o);

    /** Combine with another Xapian::Query object using OP_XOR.
     *
     *  @since Since Xapian 1.4.10, when called on a Query object which is
     *  OP_XOR and has a reference count of 1, then @a o is appended as a new
     *  subquery (provided @a o is a different Query object and
     *  <code>!o.empty()</code>).
     */
    const Query operator^=(const Query & o);

    /** Sca