Boost logo

Boost :

From: E. Gladyshev (egladysh_at_[hidden])
Date: 2003-09-26 11:56:38


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

I agree. People need to careful with static declrations anyway.

>
>
> // 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;
> }

I think you meant
      // tu2.cpp
      #include <iostream>
      class Foo
      {
         // huge class declaration
      };
 
      Foo::Foo()
      {
         std::cout << "Foo created" << std::endl;
      }
      
      Foo f;

Eugene

__________________________________
Do you Yahoo!?
The New Yahoo! Shopping - with improved product search
http://shopping.yahoo.com


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