Boost logo

Boost :

From: Paul Mensonides (pmenso57_at_[hidden])
Date: 2002-04-17 18:17:44

----- Original Message -----
From: "Andrei Alexandrescu" <andrewalex_at_[hidden]>
Newsgroups: gmane.comp.lib.boost.devel
To: <boost_at_[hidden]>
Sent: Wednesday, April 17, 2002 3:25 PM
Subject: [boost] Optimization of compilation time and consumed memory

> I understand that. Reducing compilation times and consumed memory is a
> concern that is as real as possible. I just believe that in the case of
> metaprogramming, representing all compile-time compound data structures as
> lists (much as Lisp does at runtime) and manipulating them as such is good
> enough.
> My opinion is that unlike runtime collections, type collections tend not to
> grow to huge lengths. Often, types are ultimately created by people, so it's
> not like you have tons of them. For those smaller lengths, I believe
> Lisp-style lists are good, subject to improvements of some compiler
> implementations. Now consider that you can represent any data structure you
> want with Lisp-style lists. To me, the speed of compilation argument is weak
> when made in favor of a complicated framework such as MPL.

You also slow down compile times with extra instantiations of the templates that
support the abstraction between the algorithms and the lists. I think that
speed of compilation is more about pure number of instantiations than the depth
of instantiation. That compiler-defined limit is really only there to protect
the compiler from recursing indefinitely:

template<class T> struct X {
    typedef typename X<T>::type type;

Paul Mensonides

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