Boost logo

Boost :

From: David Abrahams (dave_at_[hidden])
Date: 2003-09-26 09:12:31


"E. Gladyshev" <egladysh_at_[hidden]> writes:

> --- David Abrahams <dave_at_[hidden]> wrote:
>
> [...]
>> 1. Is our assumption about intent correct?
>>
>> 2. Regardless of what the intent may have been, is Alexander's
>> interpretation supported by the standard text (it seems to be)?
>>
>> 3. Do we have a defect?
>>
>> 4. Can something reasonably be done to make this coding idiom work
>> in a future standard without compromising on-demand loading?
>>
>> I ask #4 because it *really* is very desirable to have the capability.
>
> Perhaps the rule could look something like the following.
>
> - If the constructor of an object A references
> another object B and the translation units that contain
> object B are referenced by the program,
> then the program references all translation
> units with the static declrations of A.

That sounds like it creates undesirable dependencies. For example,

     // tu1.cpp
     #include <iostream>
     int main()
     {
        std::cout << "hello, world" << std::endl;
     }

     // tu2.cpp
     #include <iostream>
     class Foo
     {
        // huge class declaration
     };

     Foo::Foo()
     {
        std::cout << "Foo created" << std::endl;
     }

-- 
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