home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.c++
- Path: sparky!uunet!haven.umd.edu!darwin.sura.net!udel!rochester!rit!cci632!dwr
- From: dwr@cci632.cci.com (Donald W. Rouse II)
- Subject: Re: register variables in inline functions
- Message-ID: <1992Dec22.205531.26786@cci632.cci.com>
- Organization: [Computer Consoles, Inc., Rochester, NY
- References: <1992Dec14.174511.19388@cci632.cci.com> <1992Dec15.192533.26033@vedge.com>
- Date: Tue, 22 Dec 1992 20:55:31 GMT
- Lines: 29
-
- In article <1992Dec15.192533.26033@vedge.com> hendrik@vedge.com (Hendrik Boom) writes:
- >dwr@cci632.cci.com (Donald W. Rouse II) writes:
- >: In article <1992Dec10.003109.25441@bilver.uucp> dandrews@bilver.uucp (Dave Andrews) writes:
- >: >In article <1992Dec9.011428.11178@aplcen.apl.jhu.edu> ded@aplcen (nod sivad) writes:
- >: >My understanding is that both "register" and "inline" may be ignored
- >: >by your compiler. They are only hints.
- >: >
- >: MY understanding is that "inline" may be replaced with "static",
- >: but it may not be ignored.
- >
- >In
- >class foo{
- > int i;
- > inline int bar(){ return i;}
- > };
- >inline cannot be replaced with static.
-
- I forgot that you can explicitly declare member functions inline.
- (In your example, "inline" is implied.)
- I was thinking about non-member functions.
- Non-member functions declared as "inline"
- may be treated as "static" by the compiler
- (scopewise, it _must_ be treated as "static").
- The compiler may not simply ignore "inline" in that case,
- since the function name would then have global scope.
- If by ``"inline" may be ignored'' you meant that
- the compiler does not actually have to put the
- function body inline where it is invoked,
- I agree with you.
-