home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!cs.utexas.edu!sun-barr!olivea!charnel!sifon!thunder.mcrcim.mcgill.edu!sobeco!philmtl!vedge!hendrik
- From: hendrik@vedge.com (Hendrik Boom)
- Newsgroups: comp.lang.c++
- Subject: Re: register variables in inline functions
- Message-ID: <1992Dec15.192533.26033@vedge.com>
- Date: 15 Dec 92 19:25:33 GMT
- References: <1992Dec14.174511.19388@cci632.cci.com>
- Organization: Visual Edge Software Ltd.
- Lines: 32
-
- 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:
- : >>In the past, to speed up a C function's performance, one would
- : >>declare frequently used variables as "register."
- : >>But what happens with a C++ inline function? Does declaring
- : >>the variables as "register" offer any hope of greater speed?
- : >>
- : >>Supposedly, compilers are so sophisticated nowadays that
- : >>the "register" keyword is unnecessary.
- : >>
- : >My understanding is that both "register" and "inline" may be ignored
- : >by your compiler. They are only hints.
- : >
- : >- David Andrews
- : > dandrews@bilver.oau.org
- : >
- :
- : 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.
- --
- -------------------------------------------------------
- Try one or more of the following addresses to reply.
- at work: hendrik@vedge.com, iros1!vedge!hendrik
- at home: uunet!ozrout!topoi!hendrik
-