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