home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.c++
- Path: sparky!uunet!microsoft!wingnut!pauljo
- From: pauljo@microsoft.com (Paul Johns)
- Subject: Re: register variables in inline functions
- Message-ID: <1992Dec16.213225.13873@microsoft.com>
- Date: 16 Dec 92 21:32:25 GMT
- Organization: Microsoft
- References: <1992Dec15.192533.26033@vedge.com> <1992Dec14.174511.19388@cci632.cci.com>
- Lines: 38
-
- In article <1992Dec15.192533.26033@vedge.com> hendrik@vedge.com wrote:
- > dwr@cci632.cci.com (Donald W. Rouse II) 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.
- > --
-
- ...
-
- "Inline" and "static" are different concepts (and that's why
- they're different keywords). So I wouldn't expect one to
- "replace" another, even with reduced functionality.
-
- But they are similar in that when used at file scope (outside
- of a function), they both imply internal linkage (the
- identifier declared at file scope with inline or static is
- visible throughout the source file but NOT outside of the source
- file).
-
- This is where the "confusion" is coming from.
-
- // Paul Johns
-