Subject: Re: [boost] [metaparse] Practical usefulness
From: Abel Sinkovics (abel_at_[hidden])
Date: 2015-06-04 15:02:39


Hi,

On 2015-06-04 08:49, TONGARI J wrote:
> It seems to use the similar trick that I posted in an older thread (you'd
> been there too):
> http://boost.2283326.n4.nabble.com/Compile-Time-String-in-C-14-tp4666747p4666931.html
>
> We all know that it can't replace your STRING implementation since it
> cannot be used in unevaluated context.
You're right, I forgot about that thread.

> Here's a demo of toy compile-time parser that mimics Boost.Spirit:
> http://coliru.stacked-crooked.com/a/b5c0d0afd8255b81
This trick here seems to be the same as in Evgeny's code: create a
lambda function from the string and pass it to a template function as
argument and use it *inside* the template function, so no need to put
decltype around the expression containing the lambda (and therefore
using lambda in an unevaluated context can be avoided).

Regards,
   Ábel