Boost logo

Boost :

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


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

> --- David Abrahams <dave_at_[hidden]> wrote:
>
>> > [...]
>> > - 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;
>> }
>
> Sorry, I don't see static declrations in this example
> so the suggested rule doesn't apply here.
 
std::cout is an object declared at namespace scope; I assumed that's
what you meant by "static declaration".

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