2
0
mirror of https://github.com/boostorg/spirit.git synced 2026-01-19 04:42:11 +00:00

Fix roman example lambda error

error: non-local lambda expression cannot have a capture-default
This commit is contained in:
Yang Lin
2023-06-10 12:14:03 +08:00
committed by Nikita Kniazev
parent 32fb6f6899
commit ba5026b191

View File

@@ -192,9 +192,9 @@ The roman numeral grammar is a very nice and simple example of a grammar:
using x3::_attr;
using ascii::char_;
auto set_zero = [&](auto& ctx){ _val(ctx) = 0; };
auto add1000 = [&](auto& ctx){ _val(ctx) += 1000; };
auto add = [&](auto& ctx){ _val(ctx) += _attr(ctx); };
auto set_zero = [](auto& ctx){ _val(ctx) = 0; };
auto add1000 = [](auto& ctx){ _val(ctx) += 1000; };
auto add = [](auto& ctx){ _val(ctx) += _attr(ctx); };
x3::rule<class roman, unsigned> const roman = "roman";