Boost logo

Boost :

From: Terje Slettebø (tslettebo_at_[hidden])
Date: 2002-10-24 07:33:38


>From: "John Maddock" <jm_at_[hidden]>

> > I compiled 1.29.0 (Linux, gcc 3.2) and noticed that regexp library
> > (release, shared, stripped) has around 500kb. Checking the installed
> > system libraries, rx, perlre and regex are in the 50-100kb range. I
> > believe this is a bit much (and used to be even more with the older
> > versions of gcc).
>
> If you compile and link as a static library then you obviously only link
to
> what you need

Yes, but you loose the chance to inline. The compiler can typically only
inline at compile-time what is in header files. This means that to get any
inlining, you have to select which, if any, functions to inline, and put
them in the header.

With a header-only library, you can leave it to the compiler what to inline
(at least if you don't use something in the header, before it's inlined.
Having only definitions (no declarations) in the header, ensures this).
Compilation time was mentioned in this thread, is this the reason regex++ is
compiled to a static or shared library?

Could it be possible to give that choice to the user, i.e. not needing a
library to link with? That would make it a header-only library.

Regards,

Terje


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