Boost logo

Boost :

From: Paul Mensonides (pmenso57_at_[hidden])
Date: 2002-04-14 12:18:05

> How about DerivedToFront, could someone post an MPL implementation of
> it? Here I am pretty sure that MPL will at least have a compilation
> speed advantage , because Loki's algorithm is terribly inefficient. I
> should have used mergesort but... deadline pressure. Nobody complained
> so far :o).

Hey Andrei, the current version of Loki that I got from has
a huge error--DerivedToFront doesn't recurse at all:

template<class TList> struct DerivedToFront;

struct DerivedToFront<NullType>
    typedef NullType Result;

template<class Head, class Tail>
struct DerivedToFront< Typelist<Head, Tail> >
    typedef typename MostDerived<Tail, Head>::Result
    typedef typename Replace<Tail,
        TheMostDerived, Head>::Result L;
    typedef Typelist<TheMostDerived, L> Result;
    // ^ error
    // should be...
    typedef Typelist<TheMostDerived, typename DerivedToFront<L>::Result>;

Paul Mensonides

Boost list run by bdawes at, gregod at, cpdaniel at, john at