Boost logo

Boost :

Subject: Re: [boost] [threads] making parts of Boost.Threads header-only
From: Maik Beckmann (beckmann.maik_at_[hidden])
Date: 2009-04-08 01:31:09

2009/4/7 <joaquin_at_[hidden]>:
> Hi,
> Looks like a sensible part of Boost.Threads, namely that
> dealing with mutexes and locks, would be header-only
> but for its relying on boost/thread/exceptions.hpp, whose
> implementation is located at /libs/thread/*/exceptions.cpp.
> Given that this .cpp mostly consists of extremely simple
> definitions (as simple as do-nothing functions in many cases),
> would it make sense to move this to inline definitions in
> boost/thread/exceptions.hpp thus making mutexes and locks
> header-only? This would greatly enhance the appeal of this
> part of Boost.Threads, as having to link a separate module
> is a considerable burden.

General Objection:
Putting code which doesn't have to into header files causes binary
code size bloat and make code harder to read.

IMHO only interfaces belong into headers.

Unfortunately C++ templates and inline functions have reside in
header files as well, so be it.

I'm not a VisualStudio user. so I cannot speak for them, but a
reasonable build system, like cmake, eleminates this

my 2 cent,
 -- Maik

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