1 .. |iterator-category| replace:: *iterator-category*
6 *iterator-category*\ (C,R,V) :=
7 if (C is convertible to std::input_iterator_tag
8 || C is convertible to std::output_iterator_tag
12 else if (C is not convertible to incrementable_traversal_tag)
13 *the program is ill-formed*
15 else return a type X satisfying the following two constraints:
17 1. X is convertible to X1, and not to any more-derived
18 type, where X1 is defined by:
20 if (R is a reference type
21 && C is convertible to forward_traversal_tag)
23 if (C is convertible to random_access_traversal_tag)
24 X1 = random_access_iterator_tag
25 else if (C is convertible to bidirectional_traversal_tag)
26 X1 = bidirectional_iterator_tag
28 X1 = forward_iterator_tag
32 if (C is convertible to single_pass_traversal_tag
33 && R is convertible to V)
34 X1 = input_iterator_tag
39 2. |category-to-traversal|_\ (X) is convertible to the most
40 derived traversal tag type to which X is also
41 convertible, and not to any more-derived traversal tag
44 .. |category-to-traversal| replace:: *category-to-traversal*
45 .. _`category-to-traversal`: new-iter-concepts.html#category-to-traversal
47 [Note: the intention is to allow ``iterator_category`` to be one of
48 the five original category tags when convertibility to one of the
49 traversal tags would add no information]
51 .. Copyright David Abrahams 2004. Use, modification and distribution is
52 .. subject to the Boost Software License, Version 1.0. (See accompanying
53 .. file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)