From: Larry Evans (cppljevans_at_[hidden])
Date: 2005-03-16 16:46:57


On 03/06/2005 02:53 PM, Pavel Chikulaev wrote:
> "Larry Evans" <cppljevans_at_[hidden]> wrote in message
> news:d0fomr$2v7$1_at_sea.gmane.org...
>
>>I've also very curious about how this was done.
>
> I create operators tree at compile-time of rhs, then I parse it using
> templates (most challenging) and the evaluate the result.

This "parse it using templates" sound like it might be like the
application_parts template in application_parts_test.cpp:

http://boost-sandbox.sourceforge.net/vault/index.php?&direction=0&order=&directory=cppljevans/mpl

I remember thinking about calling it "parse" also (as I did before for
similar problems), but then I was worried people would confuse it with
the more conventional meaning of parse.

Anyway, application_parts is like mpl::unpack_args in that one of its
results is a place_holder expression which, when applied to the other
results, gives the original type. With unpack_args, IIUC, the
programmer has to explicitly provide the args since, as the name
implies, the arguments are "unpacked" leaving just the metafunction.