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

  1. Newsgroups: comp.lang.c++
  2. Path: sparky!uunet!pipex!warwick!bham!bhamvx!mccauleyba
  3. From: mccauleyba@vax1.bham.ac.uk (Brian McCauley)
  4. Subject: Re: inlining friend functions
  5. Sender: usenet@rs6000.bham.ac.uk (USENET News Service)
  6. Message-ID: <1992Dec16.130156.1@vax1.bham.ac.uk>
  7. Date: Wed, 16 Dec 1992 13:01:56 GMT
  8. Lines: 32
  9. References: <1992Dec15.182858.22555@aruba.uucp>
  10. Organization: University of Birmingham
  11.  
  12. In article <1992Dec15.182858.22555@aruba.uucp>, sandys@aruba.UUCP (Sandy Schindler) writes:
  13. > I would like to inline some friend functions for a class, without placing
  14. > the method definitions inside the class declaration.  Such as:
  15.    [example deleted]
  16. > BUT, when I try to compile this with Borland's C++ 3.1, I get the error
  17. > message 
  18. >   Error inl.hh, line xx: Storage class 'inline' is not allowed here 
  19. > Borland will not allow the inline keyword to used on a friend function 
  20. > inside a class declaration, no matter where the definition happens.
  21.  
  22. I never put inline in the class definition when declaring friends. Simply
  23. putting inline in the function definition is sufficient. As far as I know
  24. Borland is right and the inline storage class should only appear in a
  25. function definition and not in a friend declaration that is not also acting
  26. as the definition.
  27.  
  28. > Is this a mere compiler bug on Borland's part, or is this the first 
  29. > appearance of a standard restriction?  I hope not.  With the volume of 
  30. > code we're working on, omitting the inline keyword from the headers is not 
  31. > an option.
  32.  
  33. Wow that must be a lot of code! Assuming you do a global search/replace of
  34. "friend inline" with "friend" in *.h and it takes 1 second to answer each
  35. prompt in the time it took to write this posting you could have done
  36. several hundred.
  37. -- 
  38.     \\   ( )    No Bullshit!     |  Email: B.A.McCauley@bham.ac.uk   
  39.  .  _\\__[oo        from         |  Voice: +44 21 471 3789 (home)
  40. .__/  \\ /\@    /~)  /~[   /\/[  |    Fax: +44 21 625 2175 (work)
  41. .  l___\\      /~~) /~~[  /   [  |  Snail: 197 Harborne Lane,
  42.  # ll  l\\    ~~~~ ~   ~ ~    ~  |         Birmingham, B29 6SS, UK
  43. ###LL  LL\\   (Brian McCauley)   |   ICBM: 52.5N 1.9W
  44.