Boost logo

Boost :

From: Peder Holt (peder.holt_at_[hidden])
Date: 2006-01-19 06:36:56

On 1/19/06, Andy Little <andy_at_[hidden]> wrote:
> "Arkadiy Vertleyb" wrote
> > "Andy Little" wrote
> >
> >> if there is a large number of
> >> specialisations it will eventually have a noticeable effect on compilation
> >> times.
> >
> > According to "C++ template metaprogramming" (C.3.5) though, this effect can
> > be ignored.
> Ok I would still argue against registering evrything at once just for reasons of
> tidiness. OK I appreciate that its much more work though, so my 2nd choice would
> be to go for the 2nd approach where a common named file is included to register
> all the types for a library:
> 1 personal 'thing' for minimising macros
> 2 its easier to catch errors in a file name than #ifdef X
> 3 Its slightly more work figuring out the correct macro name than one common
> file name
> 4 Single file approach easier to manage as all registrations are in one place.
> Has the third approach using a macro got any advantages over file inclusion
> (2nd) approach?

Personally, I don't like the 2nd approach, as it introduces include
order dependencies,
<boost/a_lib/a_component.hpp> must be included prior to including

Creating a header called my_includes.hpp that contains:
#include <boost/a_lib/a_component.hpp>
#include <boost/a_lib/typeof_support.hpp>
and in my_program.cpp including

#include <my_includes.hpp>
#include <boost/a_lib/another_component.hpp>

gives a different behaviour from

#include <boost/a_lib/another_component.hpp>
#include <my_includes.hpp>

>From my perspective, this is unacceptable.

> regards
> Andy Little
> _______________________________________________
> Unsubscribe & other changes:

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