QCborArray::ConstIterator Class | Qt Core (original) (raw)

class QCborArray::ConstIterator

The QCborArray::ConstIterator class provides an STL-style const iterator for QCborArray. More...

This class is strongly comparable.

This class is strongly comparable with QCborArray::Iterator.

Public Types

Public Functions

bool operator!=(const QCborArray::ConstIterator &lhs, const QCborArray::ConstIterator &rhs)
bool operator<(const QCborArray::ConstIterator &lhs, const QCborArray::ConstIterator &rhs)
bool operator<=(const QCborArray::ConstIterator &lhs, const QCborArray::ConstIterator &rhs)
bool operator==(const QCborArray::ConstIterator &lhs, const QCborArray::ConstIterator &rhs)
bool operator>(const QCborArray::ConstIterator &lhs, const QCborArray::ConstIterator &rhs)
bool operator>=(const QCborArray::ConstIterator &lhs, const QCborArray::ConstIterator &rhs)

See also QCborArray::Iterator.

Member Type Documentation

ConstIterator::iterator_category

A synonym for std::random_access_iterator_tag indicating this iterator is a random access iterator.

Member Function Documentation

[constexpr noexcept] ConstIterator::ConstIterator()

Constructs an uninitialized iterator.

Functions like operator*() and operator++() should not be called on an uninitialized iterator. Use operator=() to assign a value to it before using it.

See also QCborArray::constBegin() and QCborArray::constEnd().

[constexpr noexcept] ConstIterator::ConstIterator(const QCborArray::ConstIterator &other)

Constructs a copy of other.

QCborValueConstRef ConstIterator::operator*() const

Returns the current item.

QCborArray::ConstIterator ConstIterator::operator+(qsizetype j) const

Returns an iterator to the item at a position j steps forward from this iterator. If j is negative, the iterator goes backward.

See also operator-() and operator+=().

QCborArray::ConstIterator &ConstIterator::operator++()

The prefix ++ operator, ++it, advances the iterator to the next item in the array and returns this iterator.

Calling this function on QCborArray::end() leads to undefined results.

See also operator--().

QCborArray::ConstIterator ConstIterator::operator++(int)

This is an overloaded function.

The postfix ++ operator, it++, advances the iterator to the next item in the array and returns an iterator to the previously current item.

QCborArray::ConstIterator &ConstIterator::operator+=(qsizetype j)

Advances the iterator by j positions. If j is negative, the iterator goes backward. Returns a reference to this iterator.

See also operator-=() and operator+().

qsizetype ConstIterator::operator-(QCborArray::ConstIterator other) const

Returns the offset of this iterator relative to other.

QCborArray::ConstIterator ConstIterator::operator-(qsizetype j) const

Returns an iterator to the item at a position j steps backward from this iterator. If j is negative, the iterator goes forward.

See also operator+() and operator-=().

QCborArray::ConstIterator &ConstIterator::operator--()

The prefix -- operator, --it, makes the preceding item current and returns this iterator.

Calling this function on QCborArray::begin() leads to undefined results.

See also operator++().

QCborArray::ConstIterator ConstIterator::operator--(int)

This is an overloaded function.

The postfix -- operator, it--, makes the preceding item current and returns an iterator to the previously current item.

QCborArray::ConstIterator &ConstIterator::operator-=(qsizetype j)

Makes the iterator go back by j positions. If j is negative, the iterator goes forward. Returns a reference to this iterator.

See also operator+=() and operator-().

const QCborValueConstRef *ConstIterator::operator->() const

Returns a pointer to the current item.

QCborArray::ConstIterator &ConstIterator::operator=(const QCborArray::ConstIterator &other)

Makes this iterator a copy of other and returns a reference to this iterator.

QCborValueConstRef ConstIterator::operator[](qsizetype _j_) const

Returns the item at a position j steps forward from the item pointed to by this iterator.

This function is provided to make QCborArray iterators behave like C++ pointers.

See also operator+().

© 2025 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.