🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.std.c++
Article #3174

Re: friend inline vs inline friend

#3174
From: James Kanze US/ESC 60/3/141 #407...
Date: Thu, 01 Feb 1996 01:58
40 lines
2291 bytes
In article <sc68e0s5bn.fsf@lnscu1.lns.cornell.edu>
nk@lns598.lns.cornell.edu (Nobuhiko Katayama) writes:

|> 	Where in the draft standard, if any, says one can use (in the
|> class declaration),

|> friend inline void a(A&);

|> but not

|> inline friend void a(A&);

Nowhere that I can see.

The keyword `friend' occurs as part of the decl-specifier-seq.  This
is an unordered sequence of keywords and typenames.  As far as I can
tell, even

	const char inline unsigned friend * f() ;

is be legal.  (Just because you can do it doesn't mean you
should:-).

In general, I think that good coding practice would impose a
systematic order of some sort, but the importance is consistency, not
the actual order.  (My own preference is: storage-class/typedef/friend
inline virtual/explicit type-specifier cv_qualifiers.  Withing the
type-specifier, I would generally place signed/unsigned first, and
short or long before int or double.  This preference is at least
partially historically conditioned, though.  It corresponds to what I
saw in the first C code I read.)
--
James Kanze         Tel.: (+33) 88 14 49 00        email: kanze@gabi-soft.fr
GABI Software, Sarl., 8 rue des Francs-Bourgeois, F-67000 Strasbourg, France
Conseils, itudes et rialisations en logiciel orienti objet --
                -- A la recherche d'une activiti dans une region francophone
---
[ comp.std.c++ is moderated.  Submission address: std-c++@ncar.ucar.edu.
  Contact address: std-c++-request@ncar.ucar.edu.  The moderation policy
  is summarized in http://dogbert.lbl.gov/~matt/std-c++/policy.html. ]
Technical Details
Message-ID: <KANZE.96Jan31174421@slsvewt.lts.sel.alcatel.de>
Path: arc1-ca.pugleaf.net!in2.uu.net!bounce-back
References: <sc68e0s5bn.fsf@lnscu1.lns.cornell.edu>

Show Full Headers
Complete Article Headers
From: kanze@lts.sel.alcatel.de (James Kanze US/ESC 60/3/141 #40763)
Message-ID: <KANZE.96Jan31174421@slsvewt.lts.sel.alcatel.de>
X-Original-Date: 31 Jan 1996 16:44:21 GMT
Path: arc1-ca.pugleaf.net!in2.uu.net!bounce-back
Date: 01 Feb 96 01:58:36 GMT
Approved: fjh@cs.mu.oz.au
Newsgroups: comp.std.c++
Subject: Re: friend inline vs inline friend
In-Reply-To: nk@lns598.lns.cornell.edu's message of 25 Jan 1996 16:12:11 GMT
Organization: SEL
References: <sc68e0s5bn.fsf@lnscu1.lns.cornell.edu>
Apparently-To: std-c++@ncar.ucar.edu
X-Auth: PGPMoose V1.1 PGP comp.std.c++
 iQBFAgUBMRAeW+EDnX0m9pzZAQGETwF9HcbiN6cJXUt4h4+WqaBjc3oa/8urfvXf
 4Pae/z1MmmroMYJUXUtLP+MOqQcdxsPs
 =UO6D