6 template <class SourcePosition, class Ch>
9 This is a [link lazy_metafunction lazy template metafunction].
13 [[`SourcePosition`] [[link source_position source position]]]
14 [[`Ch`] [[link boxed_value boxed] character value. The character `SourcePosition` points to in the input.]]
19 Returns a new source position, pointing to the beginning of the next line.
23 #include <boost/metaparse/next_line.hpp>
25 [h1 Expression semantics]
27 For any `s` source position and `c` wrapped character the following are
30 get_col<next_line<s, c>>::type
34 get_line<next_line<s, c>>
36 boost::mpl::plus<get_line<s>::type, boost::mpl::int_<1>>
38 get_prev_char<next_line<s, c>>::type
44 #include <boost/metaparse/next_line.hpp>
45 #include <boost/metaparse/source_position.hpp>
46 #include <boost/metaparse/get_col.hpp>
47 #include <boost/metaparse/get_line.hpp>
48 #include <boost/metaparse/get_prev_char.hpp>
50 #include <type_traits>
52 using namespace boost::metaparse;
54 struct returns_source_position
58 std::integral_constant<int, 11>,
59 std::integral_constant<int, 13>,
60 std::integral_constant<char, 'a'>
66 using type = std::integral_constant<char, '\n'>;
73 std::integral_constant<int, 11>,
74 std::integral_constant<int, 13>,
75 std::integral_constant<char, 'a'>
77 std::integral_constant<char, '\n'>
80 "it should set the column to 1"
87 std::integral_constant<int, 11>,
88 std::integral_constant<int, 13>,
89 std::integral_constant<char, 'a'>
91 std::integral_constant<char, '\n'>
94 "it should increase the line component of the source position"
101 std::integral_constant<int, 11>,
102 std::integral_constant<int, 13>,
103 std::integral_constant<char, 'a'>
105 std::integral_constant<char, '\n'>
107 >::type::value == '\n',
108 "it should update the prev char component of the source position"
112 get_col<next_line<returns_source_position, returns_char>>::type::value == 1,
113 "it should support lazy evaluation"