accept.qbk 1.46 KB
[#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]