|
Boost : |
From: David Abrahams (david.abrahams_at_[hidden])
Date: 2002-06-30 07:56:50
From: "Itay Maman" <itay_maman_at_[hidden]>
> 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,
I don't see how size can be done in O(1) on a typelist.
> so I cannot see how can I
> optimize it any further.
I think you got it backwards. Those are algorithms, and assembling your own
loop out of those pieces is probably less-efficient than using a canned
for_each.
-Dave
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk