diff --git a/include/concise.h b/include/concise.h index 7d93b1b..d15d251 100644 --- a/include/concise.h +++ b/include/concise.h @@ -431,7 +431,7 @@ template class ConciseSet { const_iterator begin() const; - const_iterator end() const; + const_iterator & end() const; bool contains(uint32_t o) const { if (isEmpty() || ((int32_t)o > last) || (o > MAX_ALLOWED_INTEGER)) { @@ -1018,7 +1018,8 @@ ConciseSet::begin() const { } template -inline ConciseSetBitForwardIterator +inline ConciseSetBitForwardIterator& ConciseSet::end() const { - return ConciseSetBitForwardIterator(*this, true); + static ConciseSetBitForwardIterator endp(*this, true); + return endp; }