ForwardTraversal.rst 2.5 KB

12345678910111213141516171819202122232425262728293031
  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. Forward Traversal Concept
  5. .........................
  6. A class or built-in type ``X`` models the *Forward Traversal*
  7. concept if, in addition to ``X`` meeting the requirements of Default
  8. Constructible and Single Pass Iterator, the following expressions are
  9. valid and respect the stated semantics.
  10. +--------------------------------------------------------------------------------------------------------+
  11. |Forward Traversal Iterator Requirements (in addition to Default Constructible and Single Pass Iterator) |
  12. +---------------------------------------+-----------------------------------+----------------------------+
  13. |Expression |Return Type |Assertion/Note |
  14. +=======================================+===================================+============================+
  15. |``X u;`` |``X&`` |note: ``u`` may have a |
  16. | | |singular value. |
  17. +---------------------------------------+-----------------------------------+----------------------------+
  18. |``++r`` |``X&`` |``r == s`` and ``r`` is |
  19. | | |dereferenceable implies |
  20. | | |``++r == ++s.`` |
  21. +---------------------------------------+-----------------------------------+----------------------------+
  22. |``iterator_traits<X>::difference_type``|A signed integral type representing| |
  23. | |the distance between iterators | |
  24. | | | |
  25. +---------------------------------------+-----------------------------------+----------------------------+
  26. |``iterator_traversal<X>::type`` |Convertible to | |
  27. | |``forward_traversal_tag`` | |
  28. +---------------------------------------+-----------------------------------+----------------------------+