返回介绍

QMapConstIterator Class

发布于 2019-10-04 15:01:23 字数 5090 浏览 905 评论 0 收藏 0

The QMapConstIterator class provides an iterator for QMap. More...

#include <qmap.h>

List of all member functions.

Public Members

  • typedef std::bidirectional_iterator_tagiterator_category
  • typedef Tvalue_type
  • typedef constT*pointer
  • typedef constT&reference
  • QMapConstIterator ()
  • QMapConstIterator ( QMapNode<K,T>*p )
  • QMapConstIterator ( constQMapConstIterator<K,T>&it )
  • QMapConstIterator ( constQMapIterator<K,T>&it )
  • bool operator== ( constQMapConstIterator<K,T>&it ) const
  • bool operator!= ( constQMapConstIterator<K,T>&it ) const
  • const T & operator* () const
  • const K & key () const
  • const T & data () const
  • QMapConstIterator<K, T> & operator++ ()
  • QMapConstIterator<K, T> operator++ ( int )
  • QMapConstIterator<K, T> & operator-- ()
  • QMapConstIterator<K, T> operator-- ( int )

Detailed Description

The QMapConstIterator class provides an iterator for QMap.

In contrast to QMapIterator, this class is used to iterate over a const map. It does not allow you to modify the values of the map because this would break the const semantics.

For more information on QMap iterators, see QMapIterator. and the QMap example.

See also QMap, QMapIterator, Qt Template Library Classes and Non-GUI Classes.


Member Type Documentation

QMapConstIterator::iterator_category

The type of iterator category, std::bidirectional_iterator_tag.

QMapConstIterator::pointer

Const pointer to value_type.

QMapConstIterator::reference

Const reference to value_type.

QMapConstIterator::value_type

The type of const value.

Member Function Documentation

QMapConstIterator::QMapConstIterator ()

Constructs an uninitialized iterator.

QMapConstIterator::QMapConstIterator ( QMapNode<K,T>*p )

Constructs an iterator starting at node p.

QMapConstIterator::QMapConstIterator ( constQMapConstIterator<K,T>&it )

Constructs a copy of the iterator, it.

QMapConstIterator::QMapConstIterator ( constQMapIterator<K,T>&it )

Constructs a copy of the iterator, it.

const T & QMapConstIterator::data () const

Returns a const reference to the data of the current item.

const K & QMapConstIterator::key () const

Returns a const reference to the current key.

bool QMapConstIterator::operator!= ( constQMapConstIterator<K,T>&it ) const

Compares the iterator to the it iterator and returns FALSE if they point to the same item; otherwise returns TRUE.

const T & QMapConstIterator::operator* () const

Dereference operator. Returns a const reference to the current item. The same as data().

QMapConstIterator<K,T>& QMapConstIterator::operator++ ()

Prefix ++ makes the succeeding item current and returns an iterator pointing to the new current item. The iterator cannot check whether it reached the end of the map. Incrementing the iterator returned by end() causes undefined results.

QMapConstIterator<K,T> QMapConstIterator::operator++ ( int )

This is an overloaded member function, provided for convenience. It behaves essentially like the above function.

Postfix ++ makes the succeeding item current and returns an iterator pointing to the new current item. The iterator cannot check whether it reached the end of the map. Incrementing the iterator returned by end() causes undefined results.

QMapConstIterator<K,T>& QMapConstIterator::operator-- ()

Prefix -- makes the previous item current and returns an iterator pointing to the new current item. The iterator cannot check whether it reached the beginning of the map. Decrementing the iterator returned by begin() causes undefined results.

QMapConstIterator<K,T> QMapConstIterator::operator-- ( int )

This is an overloaded member function, provided for convenience. It behaves essentially like the above function.

Postfix -- makes the previous item current and returns an iterator pointing to the new current item. The iterator cannot check whether it reached the beginning of the map. Decrementing the iterator returned by begin() causes undefined results.

bool QMapConstIterator::operator== ( constQMapConstIterator<K,T>&it ) const

Compares the iterator to the it iterator and returns TRUE if they point to the same item; otherwise returns FALSE.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
    我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
    原文