home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #30 / NN_1992_30.iso / spool / comp / lang / cplus / 18031 < prev    next >
Encoding:
Text File  |  1992-12-15  |  1.5 KB  |  43 lines

  1. Path: sparky!uunet!cs.utexas.edu!sun-barr!olivea!charnel!sifon!thunder.mcrcim.mcgill.edu!sobeco!philmtl!vedge!hendrik
  2. From: hendrik@vedge.com (Hendrik Boom)
  3. Newsgroups: comp.lang.c++
  4. Subject: Re: register variables in inline functions
  5. Message-ID: <1992Dec15.192533.26033@vedge.com>
  6. Date: 15 Dec 92 19:25:33 GMT
  7. References: <1992Dec14.174511.19388@cci632.cci.com>
  8. Organization: Visual Edge Software Ltd.
  9. Lines: 32
  10.  
  11. dwr@cci632.cci.com (Donald W. Rouse II) writes:
  12. : In article <1992Dec10.003109.25441@bilver.uucp> dandrews@bilver.uucp (Dave Andrews) writes:
  13. : >In article <1992Dec9.011428.11178@aplcen.apl.jhu.edu> ded@aplcen (nod sivad) writes:
  14. : >>In the past, to speed up a C function's performance, one would
  15. : >>declare frequently used variables as "register."  
  16. : >>But what happens with a C++ inline function?  Does declaring
  17. : >>the variables as "register" offer any hope of greater speed?
  18. : >>
  19. : >>Supposedly, compilers are so sophisticated nowadays that
  20. : >>the "register" keyword is unnecessary. 
  21. : >>
  22. : >My understanding is that both "register" and "inline" may be ignored
  23. : >by your compiler.  They are only hints.
  24. : >
  25. : >- David Andrews
  26. : >  dandrews@bilver.oau.org
  27. : >
  28. : MY understanding is that "inline" may be replaced with "static",
  29. : but it may not be ignored.
  30.  
  31. In 
  32. class foo{
  33.     int i;
  34.     inline int bar(){ return i;}
  35.     };
  36. inline cannot be replaced with static.
  37. -- 
  38. -------------------------------------------------------
  39. Try one or more of the following addresses to reply.
  40. at work:    hendrik@vedge.com,  iros1!vedge!hendrik
  41. at home:    uunet!ozrout!topoi!hendrik
  42.