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

  1. Newsgroups: comp.lang.c++
  2. Path: sparky!uunet!microsoft!wingnut!pauljo
  3. From: pauljo@microsoft.com (Paul Johns)
  4. Subject: Re: register variables in inline functions
  5. Message-ID: <1992Dec16.213225.13873@microsoft.com>
  6. Date: 16 Dec 92 21:32:25 GMT
  7. Organization: Microsoft
  8. References: <1992Dec15.192533.26033@vedge.com> <1992Dec14.174511.19388@cci632.cci.com>
  9. Lines: 38
  10.  
  11. In article <1992Dec15.192533.26033@vedge.com> hendrik@vedge.com wrote:
  12. > dwr@cci632.cci.com (Donald W. Rouse II) writes:
  13.  
  14. ...
  15.  
  16. > : >My understanding is that both "register" and "inline" may be ignored
  17. > : >by your compiler.  They are only hints.
  18. > : >
  19.  
  20. ...
  21.  
  22. > : 
  23. > : MY understanding is that "inline" may be replaced with "static",
  24. > : but it may not be ignored.
  25. > In 
  26. > class foo{
  27. >     int i;
  28. >     inline int bar(){ return i;}
  29. >     };
  30. > inline cannot be replaced with static.
  31. > -- 
  32.  
  33. ...
  34.  
  35. "Inline" and "static" are different concepts (and that's why
  36. they're different keywords).  So I wouldn't expect one to
  37. "replace" another, even with reduced functionality.
  38.  
  39. But they are similar in that when used at file scope (outside 
  40. of a function), they both imply internal linkage (the 
  41. identifier declared at file scope with inline or static is 
  42. visible throughout the source file but NOT outside of the source 
  43. file).
  44.  
  45. This is where the "confusion" is coming from.
  46.  
  47. // Paul Johns
  48.