Boost logo

Boost :

From: David Abrahams (dave_at_[hidden])
Date: 2003-09-24 19:47:42


"Scott Woods" <scottw_at_[hidden]> writes:

>> Alexander Nasonov <alnsn-mycop_at_[hidden]> writes:
>>
>> > Any interest in static_list class?
>>
>> It's a nice idea to formalize this. I've used the idiom in the past.
>> The one *major* problem with it is that a translation unit's static
>> initialization is not required to happen until such time as some
>> function in that translation unit is invoked. The result is that you
>> can't simply link together TUs which contain some class description
>> and the associated registration object, and expect the registration to
>> happen.
>>
>> Ultimately, to be reliable, you need explicit calls to initialization
>> functions :(, which makes this technique much less useful than it
>> could be.
>
> My $0.02.
>
> Nice idea and have had similar problems (as above).
>
> Thought that the criteria for inclusion of a library module
> into the executable image was "any reference to a symbol",
> i.e. not limited to functions?
>
> Have tried several different approaches to fix the "problem"
> and basically couldnt really beat it. As long as you use libraries
> (as opposed to straight objs) as one of your engineering tools
> your hosed but the effort did result in some spin-offs.

There's nothing special about libraries according to the standard,
and in fact some implementations will exhibit the same behavior
whether you're using a library or an object file.

-- 
Dave Abrahams
Boost Consulting
www.boost-consulting.com

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