Ignore:
Timestamp:
Jul 1, 2015, 3:30:08 PM (4 years ago)
Author:
nmedfort
Message:

Temporary check-in.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • icGREP/icgrep-devel/icgrep/UCD/unicode_set.h

    r4626 r4627  
    5555        friend class boost::iterator_core_access;
    5656    protected:
    57         iterator(RunVector::const_iterator runIterator, QuadVector::const_iterator quadIterator,
    58                  RunVector::const_iterator runEnd, QuadVector::const_iterator quadEnd)
     57
     58        iterator(const RunVector::const_iterator runIterator, const QuadVector::const_iterator quadIterator, const codepoint_t baseCodePoint)
    5959        : mRunIterator(runIterator), mQuadIterator(quadIterator)
    60         , mMixedRunIndex(0), mQuadOffset(0), mBaseCodePoint(0), mMinCodePoint(0), mMaxCodePoint(0)
    61         , mRunEnd(runEnd), mQuadEnd(quadEnd)
    62         {
     60        , mMixedRunIndex(0), mQuadOffset(0), mBaseCodePoint(baseCodePoint), mMinCodePoint(baseCodePoint), mMaxCodePoint(baseCodePoint) {
    6361
    6462        }
     
    7573
    7674        inline bool equal(const iterator & other) const {
    77             return (mRunIterator == other.mRunIterator) && (mQuadIterator == other.mQuadIterator) &&
    78                    (mMixedRunIndex == other.mMixedRunIndex) && (mQuadOffset == other.mQuadOffset);
     75            return (mMinCodePoint == other.mMinCodePoint);
    7976        }
    8077    private:
     
    8683        codepoint_t                         mMinCodePoint;
    8784        codepoint_t                         mMaxCodePoint;
    88         const RunVector::const_iterator     mRunEnd;
    89         const QuadVector::const_iterator    mQuadEnd;
    9085    };
    9186
    9287    inline iterator begin() const {
    93         // note: pre-increment is intentional to move the iterator onto the first non-Empty interval.
    94         return ++iterator(mRuns.cbegin(), mQuads.cbegin(), mRuns.cend(), mQuads.cend());
     88        // note: preincrement forces the iterator to advance onto and capture the first interval.
     89        return ++iterator(mRuns.cbegin(), mQuads.cbegin(), 0);
    9590    }
    9691
    9792    inline iterator end() const {
    98         return iterator(mRuns.cend(), mQuads.cend(), mRuns.cend(), mQuads.cend());
     93        return iterator(mRuns.cend(), mQuads.cend(), 0x110000);
    9994    }
    10095
Note: See TracChangeset for help on using the changeset viewer.