Boost logo

Boost :

Subject: Re: [boost] [metaparse] Practical usefulness
From: Abel Sinkovics (abel_at_[hidden])
Date: 2015-06-04 01:52:59


Hi Evgeny

On 2015-06-03 23:32, Evgeny Panasyuk wrote:
> 03.06.2015 23:45, Abel Sinkovics:
>
> JFYI, I made small test some time ago with "formatting" stuff at
> compile-time (ad-hoc parsing, without Metaparse).
> https://github.com/panaseleus/ctte
Very interesting. Not just the way you generate code, but also the way
you pass string literals to metafunctions. Your variadic template +
std::make_index_sequence trick seems to be able to replace the macro
magic for compile-time string construction. It looks like
BOOST_<whatever we end up with>_STRING could be improved with that (I'll
have to check).

Note that you should be able to "store" the length of the string in what
CTTE_WRAP_STRING constructs (you can get the length with sizeof or with
"pattern matching" on the char array length) and then you can also deal
with the corner case when a string literal contains \0 characters.

Regards,
   Ábel


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