Article View: comp.std.c++
Article #799static functions
From: John Kewley ICL
Date: Tue, 22 Jan 1991 14:56
Date: Tue, 22 Jan 1991 14:56
40 lines
1529 bytes
1529 bytes
I have had problems trying to write a class with members who have static extent.
They are only accessed in their definition file and nowhere else.
There seems to be no way to declare a member function static, as opposed to
a static member function. Would it not be preferable to declare static member
functions using a postfixed static rather than a prefixed one in the style of
the 2 meanings of the const keyword when applied to functions.
e.g.
static int get_static_assoc_no() const
{
return(static_assoc_no);
}
would become:
int get_static_assoc_no() const static
{
return(static_assoc_no);
}
and a member which was only accessed within the current file, could be
declared:
static local_class::local_class(/* .. */)
{
/*
.
.
*/
}
Please don't flame me too hard, I currently have to use inline to get this
functionality!
--
J.K.
John M. Kewley, ICL, Wenlock Way, West Gorton, Manchester. M12 5DR
Tel: (+44) 61 223 1301 X2138 Email: jk@cs.man.ac.uk / jk@nw.stl.stc.co.uk
Technical Details
Message-ID:
<2036@m1.cs.man.ac.uk>Path:
arc1-ca.pugleaf.net!utzoo!censor!geac!torsqnt!lethe!yunexus!ists!helios.physics.utoronto.ca!news-server.csri.toronto.edu!bonnie.concordia.ca!uunet!mcsun!ukc!mucs!jkShow Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!censor!geac!torsqnt!lethe!yunexus!ists!helios.physics.utoronto.ca!news-server.csri.toronto.edu!bonnie.concordia.ca!uunet!mcsun!ukc!mucs!jk From: jk@cs.man.ac.uk (John Kewley ICL) Newsgroups: comp.std.c++ Subject: static functions Message-ID: <2036@m1.cs.man.ac.uk> Date: 22 Jan 91 14:56:58 GMT Sender: news@cs.man.ac.uk Reply-To: jk@cs.man.ac.uk (John Kewley ICL) Organization: Department of Computer Science, University of Manchester UK Lines: 40