File: tokenized.qbk

package info (click to toggle)
boost1.83 1.83.0-5
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 545,632 kB
  • sloc: cpp: 3,857,086; xml: 125,552; ansic: 34,414; python: 25,887; asm: 5,276; sh: 4,799; ada: 1,681; makefile: 1,629; perl: 1,212; pascal: 1,139; sql: 810; yacc: 478; ruby: 102; lisp: 24; csh: 6
file content (67 lines) | stat: -rw-r--r-- 2,059 bytes parent folder | download | duplicates (11)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
[/
    Copyright 2010 Neil Groves
    Distributed under the Boost Software License, Version 1.0.
    (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
/]
[section:tokenized tokenized]

[table
    [[Syntax] [Code]]
    [
        [Pipe]
        [
            ``
            rng | boost::adaptors::tokenized(regex)
            rng | boost::adaptors::tokenized(regex, i)
            rng | boost::adaptors::tokenized(regex, rndRng)
            rng | boost::adaptors::tokenized(regex, i, flags)
            rng | boost::adaptors::tokenized(regex, rndRng, flags)
            ``
        ]
    ]
    [
        [Function]
        [
            ``
            boost::adaptors::tokenize(rng, regex)
            boost::adaptors::tokenize(rng, regex, i)
            boost::adaptors::tokenize(rng, regex, rndRng)
            boost::adaptors::tokenize(rng, regex, i, flags)
            boost::adaptors::tokenize(rng, regex, rndRng, flags)
            ``
        ]
    ]
]

* [*Precondition:]
    * Let `T` denote `typename range_value<decltype(rng)>::type`, then `regex` has the type `basic_regex<T>` or is implicitly convertible to one of these types.
    * `i` has the type `int`.
    * the `value_type` of `rndRng` is `int`.
    * `flags` has the type `regex_constants::syntax_option_type`.
* [*Returns:] A range whose iterators behave as if they were the original iterators wrapped in `regex_token_iterator`. The first iterator in the range would be constructed by forwarding all the arguments of `tokenized()` to the `regex_token_iterator` constructor.
* [*Throws:] Whatever constructing and copying equivalent `regex_token_iterator`s might throw.
* [*Range Category:] __random_access_range__
* [*Range Return Type:] `boost::tokenized_range<decltype(rng)>`
* [*Returned Range Category:] __random_access_range__

[section:tokenized_example tokenized_example]
[import ../../../test/adaptor_test/tokenized_example.cpp]
[tokenized_example]
[endsect]

This would produce the output:
``
a
b
c
d
e
f
g
hijklmnopqrstuvwxyz

``

[endsect]