Recently a lot of problems with make_attribute and transform_attribute traits were uncovered at fixing #444. I think the problem is that the trait does not have constrains, example:
|
template <typename Exposed, typename Transformed> |
|
void post_transform(Exposed& dest, Transformed&& attr) |
|
{ |
|
return transform_attribute<Exposed, Transformed, x3::parser_id> |
|
::post(dest, std::forward<Transformed>(attr)); |
|
} |
Because template parameter behind
attr is a forwarding reference
Transformed will be reference, but
transform_attribute does not expect
Transformed to be a reference and even const qualifier.
Update: It is not clear to me if const can never appear in Transformed, so will do not touch as for now.
Recently a lot of problems with
make_attributeandtransform_attributetraits were uncovered at fixing #444. I think the problem is that the trait does not have constrains, example:spirit/include/boost/spirit/home/x3/nonterminal/detail/transform_attribute.hpp
Lines 102 to 107 in 4b2b443
Because template parameter behind
attris a forwarding referenceTransformedwill be reference, buttransform_attributedoes not expectTransformedto be a reference and even const qualifier.and const typestoTransformedparameter.traits::pre_transformandtraits::post_transformtraits to be sure both pre and post uses the same transformation trait.Exposedparameter.Update: It is not clear to me if const can never appear in
Transformed, so will do not touch as for now.