Re: A89: ASM Mentoring


[Prev][Next][Index][Thread]

Re: A89: ASM Mentoring




Hi!

> The C++ statement makes only one function call, to the
> ostream::operator<<(char *) function, and that function only 
> needs to be able to deal with strings. There is no reason that
> any other ostream functions (other than a constructor, which 
> doesn't need to do much) would need to be linked. Of course 
> this all depends on the implementation.

Principally, you are right, but in all C++ implementations I
ever seen, the whole ostream object is linked in the code when
you use cout << "Hello!". Generally, linkers usually linked
whole objects in the package, independently of what is used
from the object. This is not smart, but if this stupid rule
is violated, it becomes very hard to implement inheritance
from the aspects of the linker.

Zeljko