Boost logo

Boost :

Subject: Re: [boost] compile time parser generator
From: Ábel Sinkovics (abel_at_[hidden])
Date: 2012-01-10 02:16:43


Hi Luke,

>
> There are a lot of tasks in TMP that are very tedious due to the verbose nature of the language. Instead of macros, could we define a language for scripting template metaprogramming that we use in string arguments to template parameters that expand at compile time into complex metaprogramming behaviors? Could this really make our lives better?

You can compile embedded strings into template metafunction classes.
I've added an example EDSL + parser for template metaprogramming lambda
expressions
(https://github.com/sabel83/mpllibs/tree/master/libs/metaparse/example/meta_lambda).
Here is how you can use it:

   typedef META_LAMBDA(2 * _) metafunction_class;

   metafunction_class::apply<int_<13>>::type

Note that it has a significant effect on the compilation speed of the
C++ code.

Regards,
   Ábel


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