Boost logo

Boost :

From: Jeff Garland (jeff_at_[hidden])
Date: 2007-04-03 22:22:18

Sohail Somani wrote:
>> -----Original Message-----

> Yes but if you compile boost along with your code, what is the problem?
> I used to be of the opinion that I should use pre-built boost. Not
> anymore. I prefer building it myself.

That's your choice, but the whole point of this is that it's empirically
harder to deal with built-libraries. It's not a theory, as far as I'm
concerned, it's a fact based on reading this mailing list for years. With
libraries like smart_ptr the 'how to build' issue just doesn't come up because
it's simply effortless. With 'built' libs it comes up frequently.

> Why should I compile a piece of code more than once in a specific build?
> If 3 different libraries in my build use boost regex, well damnit I
> don't want to build boost regex 3 times!

Ok, with template code "inclusion" != "compile". It's not free, but it's not
as expensive as a full compile either.

> It is *definitely* harder to run bjam than add the cpp files to your
> "project". I think I can say this as a Boost user. I say this also while
> watching another email popping into the inbox with "Troubles with build
> boost".

In my case, I typically don't use and IDE, so bjam is far easier than writing
a Makefile. But the nice thing about bjam is that, like emacs, it behaves
basically the same on every platform. So I don't have to learn some fancy
platform specific ide to run and test on a different platform. So, there are
some real benefits to bjam for cross-platform development that 'whatever-ide'
does not posses.

> Ok, self-configuring hpp files are great. Why not have self-configuring
> cpp files?
> Another reason is that I am of the opinion that if boost regex cannot be
> built with certain warnings on,

Patches, I'm sure, would be graciously accepted ;-)

> that should not affect the rest of my
> code. Well, with header-only, it does. Should I be punished for this?

No worries. If it can't be fixed, use

  //darn regex has warnings -- turn it off!
  #pragma warning(push)
  #pragma warning(disable : xxxx)
  #include "boost/regex.hpp"
  #pragma warning(pop)

Of course, regex isn't 'all header' so I'm not sure why we're discussing it as
an example. And with VC8 you have to do this for much of the standard library
as well:

> I mean, there have been cases where people have had to work on a library
> where a sh*tload of code is in the header, but they refused to work on
> that code until it was separately compiled, appropriately inlined
> functions and templates excluded obviously.

Well, I assume you're talking about in your own developers because I'm not
aware of a boost library that doesn't meet the 'appropriately inlined or
template' exclusion.

> PS: I already get punished with boost.thread if I disable language
> extensions with MSVC. I've come to terms with it.

At the risk of going off-topic, what was the punishment? I'm guessing you
might be using an old version of msvc which can't handle thread (or stl for
that matter) without the 'extensions'? In any case, have you reported it? If
you have, it's always possible the fix is bottled up in the 1.34 release


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