source_position.qbk 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. [#source_position]
  2. [section source_position]
  3. [h1 Synopsis]
  4. template <class Line, class Col, class PrevChar>
  5. struct source_position;
  6. This is a [link metaprogramming_value template metaprogramming value].
  7. [table Arguments
  8. [[Name] [Type]]
  9. [[`Line`] [[link boxed_value boxed] integer value]]
  10. [[`Col`] [[link boxed_value boxed] integer value]]
  11. [[`PrevChar`] [[link boxed_value boxed] character value]]
  12. ]
  13. [h1 Description]
  14. Compile-time data-structure describing a position of the input text.
  15. The values of this data-structure store the last character that was parsed
  16. before reaching the position of the input described by the `source_position`
  17. value.
  18. Its tag is [link source_position_tag `source_position_tag`].
  19. The beginning of the input text is represented by [link start `start`].
  20. [h1 Header]
  21. #include <boost/metaparse/source_position.hpp>
  22. [h1 Expression semantics]
  23. For any `l`, `c` compile-time boxed integral values and `p` compile-time boxed
  24. character value, the following are equivalent
  25. get_col<source_position<l, c, p>>::type
  26. c::type
  27. get_line<source_position<l, c, p>>::type
  28. l::type
  29. get_prev_char<source_position<l, c, p>>::type
  30. p::type
  31. [h1 Constant values of this type]
  32. * [link start `start`]
  33. [h1 Operations]
  34. * `boost::mpl::equal_to`
  35. * `boost::mpl::greater`
  36. * `boost::mpl::greater_equal`
  37. * `boost::mpl::less`
  38. * `boost::mpl::less_equal`
  39. * `boost::mpl::not_equal_to`
  40. * [link get_col `get_col`]
  41. * [link get_line `get_line`]
  42. * [link get_prev_char `get_prev_char`]
  43. * [link next_char `next_char`]
  44. * [link next_line `next_line`]
  45. [endsect]