Re: [capnproto] Parser caching: transformers would need to accept const lvalue references.

2019-07-08 Thread 'Kenton Varda' via Cap'n Proto
Hi Kuba, As a quick fix, you could always pass a pointer instead of a reference. Or you could wrap the reference in a struct. I agree that lvalue references "should" work, but it might be tricky to design the parser code such that it doesn't accidentally decide to use a reference where inappropri

[capnproto] Parser caching: transformers would need to accept const lvalue references.

2019-07-08 Thread kuba
I'm experimenting with caching lexer output, and have devised a `cache()` combinator that takes a parser outputting `Foo` and returns a parser outputting `const Foo &`. The subparser is queried only once for a given position in the input. This works a treat until you get to transforms: the funct