Boost logo

Boost :

Subject: Re: [boost] [metaparse] performance comparisons?
From: Abel Sinkovics (abel_at_[hidden])
Date: 2015-06-07 15:43:23


Hi Roland,

On 2015-06-07 21:30, Roland Bock wrote:
>
> In sqlpp11 the char_sequence contains a static function that returns a
> const char*. Storing a reference/pointer to the "original" array does
> not seem to work in all cases (after being handed through some template
> aliases, they seem to break).
>
> The char_sequence is used to compare names of objects representing
> columns, tables and the like. Instead of comparing actual strings at
> compile time, the library can compare types.
>
> Also, the char_sequence is used in serializing expressions (this is
> where that static function comes into play).
So sqlpp's use case is different from Metaparse's. (comparisons instead
of interpreting the content).

>
> Right. With the input from Evgeny I was able to change that to the
> extent, that I can now use them in-place as function arguments (but not
> as template parameters or type declarations like yours).
>
> Hmm. This might lead to an alternative syntax, btw. Instead of
>
> using X = typename exp_parser3::apply<MPLLIBS_STRING("11 ")>::type;
>
> we could call
>
> auto x = exp_parser3::apply(MPLLIBS_STRING("11 "));
>
> Not sure if and how this could be useful in the context of your library.
I expect to end up with a similar interface to this alternate one when
trying to build a Metaparse-like library around Hana.

Using parsers built with Metaparse the result of parsing can be used as
a template argument. For example:

   some_template<exp_parser3::apply<MPLLIBS_STRING("11 ")>::type>

in which case we have the unevaluated context problem again, as it would be

   some_template<decltype(exp_parser3::apply(MPLLIBS_STRING("11 "))>

with the alternate syntax.

Regards,
   Ábel


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk