Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!sol.ctr.columbia.edu!emory!wa4mei!nanovx!msa3b!kevin From: kevin@msa3b.UUCP (Kevin P. Kleinfelter) Newsgroups: comp.lang.c++ Subject: Inline Isn't Message-ID: <1666@msa3b.UUCP> Date: 4 Jun 91 18:37:24 GMT Organization: Dun and Bradstreet Software, Inc., Atlanta, GA Lines: 36 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. /**** foo.h ******/ class foo { private: int x; public: int bar (); }; /***** foo.cpp ****/ inline int bar () { return x; } /***** other.cpp *****/ #include "foo.h" void demo (void) { int i; foo f; i = f.bar(); } -- Kevin Kleinfelter @ DBS, Inc (404) 239-2347 ...gatech!nanoVX!msa3b!kevin Dun&Bradstreet Software, 3445 Peachtree Rd, NE, Atlanta GA 30326-1276