Path: utzoo!attcan!uunet!mcvax!ukc!stl!stc!root44!hrc63!pj From: pj@hrc63.co.uk (Mr P Johnson "Baddow") Newsgroups: comp.lang.c++ Subject: Re: Symbols, libraries, and friend classes Summary: A better solution Keywords: friend, linking, symbols Message-ID: <585@hrc63.co.uk> Date: 12 May 89 09:20:50 GMT References: <152@mole-end.UUCP> Organization: GEC Hirst Research Centre, Wembley, England. Lines: 31 In article <152@mole-end.UUCP>, mat@mole-end.UUCP (Mark A Terribile) writes: > In the real world, we sometimes want to provide facilities that work together > when all are present, but that don't all have to be present. For example, > having defined a String, we would like to be able (let us say) to use stream > I/O with it, but not to require that stream I/O be loaded. > > Is there merit to defining behavior such as this as part of the > language? > -- > > (This man's opinions are his own.) > From mole-end Mark Terribile A better way would be to put all the stuff in String which uses streams in a separate file. A linker will only pull in files containing functions needed by other files, so if you do not use the String IO stuff, streams will not be linked in either. Some linkers are even more intelligent and will do what you want even if all the String stuff is in one file. I do not know the AT&T compiler, but there are other circumstances than virtual functions where inlines are compiled normally. These include array initialisation (constructors have to have an address for this: I never use inline constructors because so many compilers seem to have bugs in this area). Sorry if this has been dealt with: we are running about 2 weeks behind here. Paul.