struct point
{
int x, y;
};
struct production
{
static constexpr auto whitespace = dsl::ascii::space;
static constexpr auto rule = [] {
auto integer = dsl::integer<int>;
return dsl::twice(integer, dsl::sep(dsl::comma));
}();
static constexpr auto value = lexy::construct<point>;
};
The code here is identical to the example for lexy::construct.
The documentation for
lexy::new_
on your website appears to show the wrong example.Currently it shows this:
Example 2. Construct a point on the heap and returns a std::unique_ptr
The code here is identical to the example for
lexy::construct
.