IncrementableIterator.rst 2.1 KB

1234567891011121314151617181920212223242526272829303132
  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. Incrementable Iterator Concept
  5. ..............................
  6. A class or built-in type ``X`` models the *Incrementable Iterator*
  7. concept if, in addition to ``X`` being Assignable and Copy
  8. Constructible, the following expressions are valid and respect the
  9. stated semantics.
  10. +-------------------------------------------------------------------------------------+
  11. |Incrementable Iterator Requirements (in addition to Assignable, Copy Constructible) |
  12. | |
  13. +--------------------------------+-------------------------------+--------------------+
  14. |Expression |Return Type |Assertion/Semantics |
  15. +================================+===============================+====================+
  16. |``++r`` |``X&`` |``&r == &++r`` |
  17. +--------------------------------+-------------------------------+--------------------+
  18. |``r++`` |``X`` |:: |
  19. | | | |
  20. | | | { |
  21. | | | X tmp = r; |
  22. | | | ++r; |
  23. | | | return tmp; |
  24. | | | } |
  25. +--------------------------------+-------------------------------+--------------------+
  26. |``iterator_traversal<X>::type`` |Convertible to | |
  27. | |``incrementable_traversal_tag``| |
  28. +--------------------------------+-------------------------------+--------------------+