|
Boost : |
From: Itay Maman (itay_maman_at_[hidden])
Date: 2002-06-30 01:26:31
David Abrahams wrote:
> ----- Original Message -----
> From: "Itay Maman" <itay_maman_at_[hidden]>
>
>>I believe that mpl should supply some sort of 'lite' list (no matter
>>what is the underlying implementation) which does not put such a heavy
>>weight on the compiler. Ideally, this list would support mpl::list's
>>interface, or (at least) a subset of it.
>
>
> mpl::list is just a dot-style typelist with a interface-simplifying wrapper
> on top. I am fairly certain that there is little or no overhead due to the
> structure of mpl::list itself. Rather, I think the generality of the
> algorithm implementations tend to make them slower than neccessary when
> applied to type lists. This can be solved as similar problems are solved in
> STL, by specializing the algorithms to operate efficiently on the target
> structures.
>
> -Dave
>
My variant implementation (described at the first post of this thread)
can use either Loki::Typelist or mpl::list (determined by a preprocessor
symbol). To do that I wrote several adaptors which allow the same
code-base to work with these two components. The adaptors (in the
mpl::list mode) use the following mpl primitives: next, begin, size,
front, and pop_front. I didn't want to use any mpl algorithms, so I
coded the sequence looping constructs myself. I believe that these
primitives all take O(1) in compilation time, so I cannot see how can I
optimize it any further.
-Itay.
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk