Closed tzlaine closed 7 months ago
Will this address the use case from https://github.com/tzlaine/parser/issues/63?
I don't think so, or at least I don't yet see it. The thing proposed here is taking an attribute that definitely exists, and transforming it into an attribute of a different type.
Well, not strictly directive defaulted[]
, but I can do:
transform(map_nullopt_to_default_constructed)[ (char_ >> int_) % ',') | eps ]
I get it now. Then, yes, I could definitely be used in that case. I still think writing attr(x)
is easier.
From David Sankel and me, from the Boost review:
This seems like a nice addition. Though you can certainly do this with a rule+semantic action combo, it would be much more ergonomic to be able to do this in a simpler way. I would make this a directive, like
transform(f)[p]
.