Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!swrinde!zaphod.mps.ohio-state.edu!sol.ctr.columbia.edu!emory!europa.asd.contel.com!gary From: gary@matterhorn.ctc.contel.com (Gary Bisaga x4219) Newsgroups: comp.lang.c++ Subject: Re: Inline Isn't Message-ID: <1991Jun5.082021@matterhorn.ctc.contel.com> Date: 5 Jun 91 12:20:21 GMT References: <1666@msa3b.UUCP> Sender: news@europa.asd.contel.com (News) Reply-To: gary@ctc.contel.com Organization: Contel Technology Center (until the GTE debacle) Lines: 13 Nntp-Posting-Host: matterhorn.ctc.contel.com In article <1666@msa3b.UUCP>, kevin@msa3b.UUCP (Kevin P. Kleinfelter) writes: > When one declares a class in a .h file, and specifies the body of > a member function as inline in the .cpp file, do most compilers fail > to inline it? > > i.e. In the following code, is it too much to expect that "f.bar()" gets > inlined? This would require a smart linker. > [example of putting an inline function in another file] Yes, but not because it's just the linker. The ARM (don't have it handy, so I can't remember the section reference) says that inline functions must have internal linkage, i.e., be defined in the same source file where they're used.