Article View: net.lang.c++
Article #286Constructors -- a redefinition.
From: Stephen J. Muir
Date: Fri, 15 Aug 1986 02:21
Date: Fri, 15 Aug 1986 02:21
35 lines
1375 bytes
1375 bytes
I do not like the way constructors are handled at the moment. Presently, they
must be declared in the public part of a class, but they cannot be invoked
explicitly by the user:
class x
{ int y;
x () { y = 0; }
public:
//...
};
x z; // ILLEGAL: x::x() is private
class a
{ int b;
public:
a () { b = 0; }
};
a c;
main ()
{ c.a(); //ILLEGAL: a is undefined
}
I think that a constructor should be allowed either in the public or private
part of a class definition and, if in the public part, the program may
explicitly call it.
Version 1.1, 4.2 BSD, VAX-11/750.
--
EMAIL: stephen@comp.lancs.ac.uk | Post: University of Lancaster,
UUCP: ...!mcvax!ukc!dcl-cs!stephen | Department of Computing,
Phone: +44 524 65201 Ext. 4120 | Bailrigg, Lancaster, UK.
Project:Alvey ECLIPSE Distribution | LA1 4YR
Technical Details
Message-ID:
<353@comp.lancs.ac.uk>Path:
arc1-ca.pugleaf.net!utzoo!mnetor!seismo!mcvax!ukc!dcl-cs!stephenShow Full Headers
Complete Article Headers
Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: arc1-ca.pugleaf.net!utzoo!mnetor!seismo!mcvax!ukc!dcl-cs!stephen From: stephen@comp.lancs.ac.uk (Stephen J. Muir) Newsgroups: net.lang.c++ Subject: Constructors -- a redefinition. Message-ID: <353@comp.lancs.ac.uk> Date: Thu, 14-Aug-86 22:21:47 EDT Article-I.D.: comp.353 Posted: Thu Aug 14 22:21:47 1986 Date-Received: Sun, 17-Aug-86 06:14:33 EDT Reply-To: stephen@comp.lancs.ac.uk (Stephen J. Muir) Organization: Department of Computing at Lancaster University, UK. Lines: 35