Use concepts in `x3::with`.
`x3::with` is now a CPO that inhibits ADL.
`x3::with_directive` now holds lvalue reference by reference, and rvalue by value.
This is necessary for preventing dangling reference. However, passing dangling
lvalue reference or destroying the value bound to the reference passed to
`x3::with` technically can't be detected and it is the user's responsibility to not
do such things.
Add `x3::with` test for all 4 value categories: `T`, `T const`, `T&`, `T const&`
Modernize `x3::skip`
Use concepts in `x3::skip`.
Make `x3::skip` a CPO that inhibits ADL.
`x3::reskip[...]`: new API that has the same effect as `x3::skip[...]`.
`x3::skip[...]`: deprecated in favor of `x3::reskip[...]`.
Use concepts in `x3::repeat`.
`x3::repeat` is now a CPO that inhibits ADL.
`x3::inf` is deprecated regarding overly generic name; use `x3::repeat_inf` instead.
`x3::repeat[p]` is deprecated since it has the exact same meaning as `*p`. It is
generally discouraged to provide multiple ways to achieve same the
functionality in modern C++ library design.
`x3::action` now uses concepts to dispatch `f(ctx)` or `f()`, depending on
whether `f` accepts such signature.
The dispatching implementation is moved from `call.hpp` to `action.hpp`,
as the function is only used from the `x3::action` class.
`operator/`: Deprecated. The symbol `/` normally means "ordered choice"
in PEG, and is irrelevant to semantic actions. Furthermore, using C++'s
`operator/` for this purpose may introduce surprising behavior when it's
mixed with ordinary PEG operators, for instance, the unary `operator+`,
due to precedence.
`rule` now resolves the parse function using concepts, providing
significantly faster compile time & better errors.
`core/error_handler_types.hpp`: New header to separate enum
definition.
`annotate_on_success`: Modernized.
`on_error` and `on_success` now only accepts const iterators.
This is a breaking change, but we should apply this immediately
due to the reasons described below.
Historically, Spirit has passed mutable lvalue references of the
*internal* iterators to the `on_success`/`on_error` handlers. This
behavior was semantically a mistake, because:
(1) `on_success`/`on_error` mechanism was designed to be
grammar-agnostic, and
(2) it does not make sense to modify the grammar-specific
iterator on the grammar-agnostic callback.
Furthermore, any modification to X3's internal iterator variables
may invoke undefined behavior, since we had never provided any
kind of guarantee on how those variables are processed in X3's
implementation details.
In other words, I consider the old behavior as a serious BUG
that involves undefined behavior which may even lead to
security issues.
`BOOST_SPIRIT_DECLARE`: Deprecated regarding compile-time slowness
of `BOOST_PP_SEQ_FOR_EACH`.
`BOOST_SPIRIT_DEFINE`: Ditto.
`BOOST_SPIRIT_INSTANTIATE`: Deprecated because the name was not
correctly prefixed with `X3_`.
`BOOST_SPIRIT_X3_DECLARE`: New macro with correctly prefixed name.
`BOOST_SPIRIT_X3_DEFINE`: Ditto.
`BOOST_SPIRIT_X3_INSTANTIATE`: Ditto.