Boost logo

Boost :

From: David Abrahams (dave_at_[hidden])
Date: 2003-01-10 11:45:23


"Paul Mensonides" <pmenso57_at_[hidden]> writes:

> ----- Original Message -----
> From: "David Abrahams" <dave_at_[hidden]>
>
>> "Paul Mensonides" <pmenso57_at_[hidden]> writes:
>>
>> > Which could be even shorter yet if we could get away with template
>> > template parameters.
>>
>> We can and do.
>>
>> How would you imagine it would be spelled with TTP?
>
> You asked for it. ;) Beware, this is the work of a sick mind!
> Basically, this implementation reduces the sample to an inline fold of the
> form:
>
> operation::step<X>::step<Y>::step<Z>::[ value | type ]
>
> ...where 'operation' is the type of operation and where '[ value | type ]'
> is either 'value' or 'type'.
> Ultimately, we get something similar to this (with the help of a macro to
> handle the ::template that is sometimes necessary):
>
> is_present<T>
> item <bool>
> item <int>
> item <double>
> item <std::string>
> ::value
>

<snip>

AFAICT from browsing it quickly, the significance of TTP in your code
is that you are passing templates instead of types as functions in the
interfaces to your metafunctions, which I think is inadvisable,
because it eventually breaks metafunction polymorphism.

Other than that, the final interface you show is one that's acheivable
without TTP at all.

-- 
                       David Abrahams
   dave_at_[hidden] * http://www.boost-consulting.com
Boost support, enhancements, training, and commercial distribution

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