ReadableIterator.rst 2.1 KB

1234567891011121314151617181920212223242526
  1. .. Copyright David Abrahams 2006. Distributed under the Boost
  2. .. Software License, Version 1.0. (See accompanying
  3. .. file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
  4. Readable Iterator Concept
  5. .........................
  6. A class or built-in type ``X`` models the *Readable Iterator* concept
  7. for value type ``T`` if, in addition to ``X`` being Assignable and
  8. Copy Constructible, the following expressions are valid and respect
  9. the stated semantics. ``U`` is the type of any specified member of
  10. type ``T``.
  11. +-----------------------------------------------------------------------------------------------------------------------------+
  12. |Readable Iterator Requirements (in addition to Assignable and Copy Constructible) |
  13. +-----------------------------------+------------------------+----------------------------------------------------------------+
  14. |Expression |Return Type |Note/Precondition |
  15. +===================================+========================+================================================================+
  16. |``iterator_traits<X>::value_type`` |``T`` |Any non-reference, |
  17. | | |non-cv-qualified type |
  18. +-----------------------------------+------------------------+----------------------------------------------------------------+
  19. |``*a`` | Convertible to ``T`` |pre: ``a`` is dereferenceable. If ``a == b`` then ``*a`` |
  20. | | | is equivalent to ``*b``. |
  21. +-----------------------------------+------------------------+----------------------------------------------------------------+
  22. |``a->m`` |``U&`` |pre: ``pre: (*a).m`` is well-defined. Equivalent to ``(*a).m``. |
  23. +-----------------------------------+------------------------+----------------------------------------------------------------+