home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.c++
- Path: sparky!uunet!taumet!steve
- From: steve@taumet.com (Steve Clamage)
- Subject: Re: register variables in inline functions
- Message-ID: <1992Dec16.183627.25945@taumet.com>
- Organization: TauMetric Corporation
- References: <1992Dec14.174511.19388@cci632.cci.com> <1992Dec15.192533.26033@vedge.com>
- Date: Wed, 16 Dec 1992 18:36:27 GMT
- Lines: 40
-
- 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:
- >: >>
- >: >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.
-
- Can we please cut through the crap here?
-
- Inline non-member functions have all the semantics of non-member static
- functions. Inline member functions don't have the semantics of static
- member functions. No one is talking about macro-replacement of 'inline'
- with 'static'.
-
- It is unfortunate (you might choose a stronger word) that both the
- keyword and the explanatory term "static" are overloaded with several
- unrelated meanings in C and C++. It results in confusion in
- discussions like these.
-
- Think of non-member "inline" functions as being declared "static".
-
- For member and non-member functions, "inline" is a request to the
- compiler that they be implemented more efficiently. You may or may
- not have your request fulfilled. In particular, they might be
- expanded inline, but result in less efficient code when used
- indescriminately.
- --
-
- Steve Clamage, TauMetric Corp, steve@taumet.com
-