accept.qbk 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. [#accept]
  2. [section accept]
  3. [h1 Synopsis]
  4. template <class Result, class Remaining, class Pos>
  5. struct accept;
  6. This is a [link metaprogramming_value template metaprogramming value].
  7. [table Arguments
  8. [[Name] [Type]]
  9. [[`Result`] [[link metaprogramming_value template metaprogramming value]]]
  10. [[`Remaining`] [[link string string]]]
  11. [[`Pos`] [[link source_position source position]]]
  12. ]
  13. [h1 Description]
  14. Values representing a successful parser application. It behaves as a
  15. [link lazy_metafunction lazy template metafunction]: when it is evaluated as a
  16. metafunction, it returns itself with its arguments evaluated. See expression
  17. semantics for further details.
  18. [note
  19. Note that for backward compatibility when `Result::type` is not defined,
  20. `accept<....>::type` does not evaluate `Result`. For example
  21. `accept<int, BOOST_METAPARSE_STRING("foo"), start>::type` is
  22. `accept<int, BOOST_METAPARSE_STRING("foo")::type, start::type>`. Using types
  23. that are not template metaprogramming values as `Result` is deprecated and
  24. will not work in future versions of the library.
  25. ]
  26. [h1 Expressions semantics]
  27. For any `r` template metaprogramming value, `s` compile-time string and `p`
  28. source position the following are equivalent:
  29. accept<r, s, p>::type
  30. accept<r, s::type, p::type>
  31. [h1 Header]
  32. #include <boost/metaparse/accept.hpp>
  33. [h1 Operations]
  34. * [link get_position `get_position`]
  35. * [link get_remaining `get_remaining`]
  36. * [link get_result `get_result`]
  37. [endsect]