Blame view

3rdparty/boost_1_81_0/libs/metaparse/doc/accept.qbk 1.46 KB
73ef4ff3   Hu Chunming   提交三方库
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
  [#accept]
  [section accept]
  
  [h1 Synopsis]
  
    template <class Result, class Remaining, class Pos>
    struct accept;
  
  This is a [link metaprogramming_value template metaprogramming value].
  
  [table Arguments
    [[Name]        [Type]]
    [[`Result`]    [[link metaprogramming_value template metaprogramming value]]]
    [[`Remaining`] [[link string string]]]
    [[`Pos`]       [[link source_position source position]]]
  ]
  
  [h1 Description]
  
  Values representing a successful parser application. It behaves as a
  [link lazy_metafunction lazy template metafunction]: when it is evaluated as a
  metafunction, it returns itself with its arguments evaluated. See expression
  semantics for further details.
  
  [note
  Note that for backward compatibility when `Result::type` is not defined,
  `accept<....>::type` does not evaluate `Result`. For example
  `accept<int, BOOST_METAPARSE_STRING("foo"), start>::type` is
  `accept<int, BOOST_METAPARSE_STRING("foo")::type, start::type>`. Using types
  that are not template metaprogramming values as `Result` is deprecated and
  will not work in future versions of the library.
  ]
  
  [h1 Expressions semantics]
  
  For any `r` template metaprogramming value, `s` compile-time string and `p`
  source position the following are equivalent:
  
    accept<r, s, p>::type
    
    accept<r, s::type, p::type>
  
  [h1 Header]
  
    #include <boost/metaparse/accept.hpp>
  
  [h1 Operations]
  
  * [link get_position `get_position`]
  * [link get_remaining `get_remaining`]
  * [link get_result `get_result`]
  
  [endsect]