Jean-Marc Lasgouttes wrote:

I double checked and it does check for idx. However, I see now that
any container implements lexicographic ordering tests. Question: would
the following patch make sense? Abdel, I know I have removed code
you just added, but I am wondering why we have to declare those extra
things.
Index: src/DocIterator.h
===================================================================
--- src/DocIterator.h   (révision 18363)
+++ src/DocIterator.h   (copie de travail)
@@ -213,9 +213,8 @@ public:
        operator<<(std::ostream & os, DocIterator const & cur);
        ///
        friend bool operator==(DocIterator const &, DocIterator const &);
+       ///
        friend bool operator<(DocIterator const &, DocIterator const &);
-       friend bool operator>(DocIterator const &, DocIterator const &);
-       friend bool operator<=(DocIterator const &, DocIterator const &);

I've tested without declaring those two operator in order to see if they would be implicitely using operator<(). But unfortunately, this doesn't work because of the void*() operator.

+inline
+bool operator<(DocIterator const & di1, DocIterator const & di2)
+{
+       return di1.slices_ < di2.slices_;
+}

As I said, I don't think this would work with different slices_ sizes.

Abdel.

Reply via email to