/docs/MyDocs

To get this branch, use:
bzr branch http://darksoft.org/webbzr/docs/MyDocs

« back to all changes in this revision

Viewing changes to Development/languages/C/Core/boost/iterators.txt

  • Committer: Suren A. Chilingaryan
  • Date: 2009-04-09 03:21:08 UTC
  • Revision ID: csa@dside.dyndns.org-20090409032108-w4edamdh4adrgdu3
import

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
New categories
 
2
==============
 
3
    Output: *i = a
 
4
    Input: *i is convertible to T
 
5
    Forward: *i is T& (or const T&)
 
6
    Random Access: i[n] is convertible to T
 
7
    ---------------------------------------
 
8
    
 
9
    
 
10
    Readable
 
11
    Writable
 
12
    Swappable
 
13
    Lvalue
 
14
    
 
15
    Incremental
 
16
    Single Pass
 
17
    Forward Traversal
 
18
    Bidirectional Traversal
 
19
    Random Access Traversal
 
20
    
 
21
    
 
22
    Output = Writable, Incremental
 
23
    Input = Readable, Single Pass
 
24
    Forward (const) = Readale Lvalue, Forward Traversal
 
25
    Forward (mutable) = Writable Lvalue, Forward Traversal
 
26
    BiDirectional, Random Acces, ...
 
27
    
 
28
    
 
29
Ranges
 
30
======
 
31
 A Range is a concept similar to the STL Container concept. However, a Range 
 
32
 does not necessarily:
 
33
    * own the elements that can be accessed through it,
 
34
    * have copy semantics, 
 
35
 Because of the second requirement, a Range object must be passed by reference 
 
36
 in generic code. 
 
37
 
 
38
 Since ranges are characterized by a specific underlying iterator type, we get 
 
39
 a type of range for each type of iterator. Hence we can speak of the following 
 
40
 types of ranges:
 
41
 
 
42
 Value Access
 
43
    * Readable Range
 
44
    * Writeable Range
 
45
    * Swappable Range
 
46
    * Lvalue Range 
 
47
 
 
48
 Traversal Category
 
49
    * Single Pass Range
 
50
    * Forward Range
 
51
    * Bidirectional Range
 
52
    * Random Access Range