🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

1 total messages Started by John Kewley ICL Tue, 22 Jan 1991 14:56
static functions
#799
Author: John Kewley ICL
Date: Tue, 22 Jan 1991 14:56
40 lines
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
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads