|
Boost : |
Subject: Re: [boost] [TTI] Review
From: Edward Diener (eldiener_at_[hidden])
Date: 2011-07-17 18:29:07
On 7/17/2011 5:53 PM, Dave Abrahams wrote:
>
> on Sun Jul 17 2011, Edward Diener<eldiener-AT-tropicsoft.com> wrote:
>
>> I think the nullary type syntax is cleaner syntactically and easier to
>> use. There may be a better solution for this sort of thing, but I am
>> looking for simplicity.
>>
>> The whole idea, syntactically, of the nullary type metafunctions is
>> that one passes around the metafunction itself rather than its nested
>> type, so there is much less of the ::type in the syntax. It does
>> involve using a separate set of boost::tti::mf_xxx metafunctions and
>> passing metafunctions as data, but I feel that the syntactical gain is
>> worth it.
>>
>> I really will update my documentation so that I will compare the macro
>> metafunction and nullary type metafunction usage together when dealing
>> with all of the cases of using the non-composite macro metafunctions.
>
> I will admit to not knowing any of the background here, so what I'm
> about to say may be totally irrelevant but...
>
> One can build a completely lazy MPL if you say that everything has to be
> a metafunction: all types are wrapped in nullary metafunctions before
> they are used, so you don't reach in and grab the nested ::type until
> you are ready to get the final result of your computation. Vesa
> Karvonen was the first one to do this IIUC. Unfortunately my
> experiments have revealed that if you rely on this idiom everywhere you
> get horrible compile-time performance.
What is IIUC ?
I did not add the nullary type metafunctions for "laziness" but just as
a syntactical convenience. I hope others realize that they can use them
or ignore them as they see fit and if they do slow down compile times
they should be ignored.
Eddie
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk