Boost logo

Boost :

From: Ulrich Eckhardt (doomster_at_[hidden])
Date: 2007-05-18 17:37:03


On Friday 18 May 2007 23:27:21 Gottlob Frege wrote:
> On 5/18/07, Ulrich Eckhardt <doomster_at_[hidden]> wrote:
> > Attached is a file. Copy it to the boost/signals folder and include it
> > from exactly one translation unit of your program. All it does is make an
> > on-demand compiled, statically linked library.
> >
> > <link_inplace.hpp>
>
> That's an interesting solution. Better than having boost optionally
> include code into the headers via #ifdefs (which I've heard
> suggested). IMO, at least.
>
> Now, why not just make it a cpp that I build directly (or drop into my
> IDE project directly) instead of an hpp that I need to #include into a
> (probably) otherwise blank cpp of my own?

It's a controversial thing. For one thing, I'd like to name it
link_inplace.cpp, but it might feel strange to some people to #include a .cpp
file. On the other hand, including code by including a .hpp file and only
being allowed to do that once is also strange.

I'm also thinking about naming it compile_inplace.cpp/hpp, I'm not yet sure
how to name this technique.

Now, as far as including it in your project goes, I'd say go ahead. I guess
naming it .cpp would make that easier though... point is noted.

However: if you create a dedicated file that only includes it that would be
even better. The reason is that this file doesn't have to be adapted if you
switch to a new Boost version, all you need to do is switch the include path
you give your compiler.

Uli


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