Topic: creating abstract objects (was: Virtual and Pure Virtual member functions)


Author: rfg@netcom.com (Ronald F. Guilmette)
Date: Sun, 28 Nov 1993 22:05:03 GMT
Raw View
In article <KANZE.93Nov19145004@slsvhdt.us-es.sel.de> kanze@us-es.sel.de (James Kanze) writes:
>In article <rfgCGpGLF.6CA@netcom.com> rfg@netcom.com (Ronald F.
>Guilmette) writes:
>
>|> In article <CGAxuy.40z@cbnewse.cb.att.com> grumpy@cbnewse.cb.att.com (Paul J Lucas) writes:
>|> >
>|> > False.  *Objects* of abstract base classes may not be created,
>|> > but pointers and references to them can be...
>
>|> I am unaware of any restrictions which currently prohibit the creation of
>|> objects having abstract types via `new' expressions.
>
>ARM, section 10.3: "An abstract class is a class that can be used only
>as a base class of some other class; NO OBJECTS OF AN ABSTRACT CLASS
>MAY BE CREATED except as objects representing a base class of a class
>derived from it."  (Emphasis added.)

Again, I apologize for having failed to read the rule in question.

On a separate (but related) issue I wonder if any of the experts here
assembled knows where I might find a rule which would prohibit the
following:

 struct ABSTRACT { void pure () = 0; };

 struct OTHER { ABSTRACT member; };

 void foobar ()
 {
  new OTHER;
 }

(Note that in the terminology used in the ANSI/ISO C standard at least,
"members" are *not* considered to also be "objects".)

--

-- Ronald F. Guilmette, Sunnyvale, California -------------------------------
------ domain address: rfg@netcom.com ---------------------------------------
------ uucp address: ...!uunet!netcom.com!rfg -------------------------------




Author: rfg@netcom.com (Ronald F. Guilmette)
Date: Sun, 28 Nov 1993 21:59:41 GMT
Raw View
In article <2ci4t2$ruk@senator-bedfellow.MIT.EDU> jfc@athena.mit.edu (John F Carr) writes:
>In article <rfgCGpGLF.6CA@netcom.com> rfg@netcom.com (Ronald F. Guilmette) writes:
>
>>I am unaware of any restrictions which currently prohibit the creation of
>>objects having abstract types via `new' expressions.
>
>The ARM says (10.3) "no objects of an abstract class may be created except
>as objects representing a base class of a class derived from it".  new creates
>an object (5.3.3).
>
>Did the ANSI committee change the rules?

I stand corrected.

My apologies for any misunderstanding I may have caused.

--

-- Ronald F. Guilmette, Sunnyvale, California -------------------------------
------ domain address: rfg@netcom.com ---------------------------------------
------ uucp address: ...!uunet!netcom.com!rfg -------------------------------




Author: simon@sco.COM (Simon Tooke)
Date: Mon, 29 Nov 1993 03:59:47 GMT
Raw View
In <rfgCH82oG.I0p@netcom.com> rfg@netcom.com (Ronald F. Guilmette) writes:

>On a separate (but related) issue I wonder if any of the experts here
>assembled knows where I might find a rule which would prohibit the
>following:

> struct ABSTRACT { void pure () = 0; };

> struct OTHER { ABSTRACT member; };

> void foobar ()
> {
>  new OTHER;
> }

>(Note that in the terminology used in the ANSI/ISO C standard at least,
>"members" are *not* considered to also be "objects".)

>--

>-- Ronald F. Guilmette, Sunnyvale, California -------------------------------
>------ domain address: rfg@netcom.com ---------------------------------------
>------ uucp address: ...!uunet!netcom.com!rfg -------------------------------

Section 10.3 "Abstract Classes"

"no objects of an abtract class may be created except as sub-objects of a
 class derived from it."

(a member is not a sub-object)

-simon tooke

===============================================================================
Simon Tooke  (not speaking for) SCO Canada, Inc.         Voice:  (416) 922-1937
....!scocan!simon             simon@sco.com                Fax:  (416) 922-2704
130 Bloor St. West. Suite 1001, Toronto, Ontario, Canada  M5S 1N5







Author: rfg@netcom.com (Ronald F. Guilmette)
Date: Thu, 18 Nov 1993 20:51:14 GMT
Raw View
In article <CGAxuy.40z@cbnewse.cb.att.com> grumpy@cbnewse.cb.att.com (Paul J Lucas) writes:
>
> False.  *Objects* of abstract base classes may not be created,
> but pointers and references to them can be...

I am unaware of any restrictions which currently prohibit the creation of
objects having abstract types via `new' expressions.

(Follow-ups to comp.std.c++ please.)

--

-- Ronald F. Guilmette, Sunnyvale, California -------------------------------
------ domain address: rfg@netcom.com ---------------------------------------
------ uucp address: ...!uunet!netcom.com!rfg -------------------------------




Author: jfc@athena.mit.edu (John F Carr)
Date: 19 Nov 1993 09:50:26 GMT
Raw View
In article <rfgCGpGLF.6CA@netcom.com> rfg@netcom.com (Ronald F. Guilmette) writes:

>I am unaware of any restrictions which currently prohibit the creation of
>objects having abstract types via `new' expressions.

The ARM says (10.3) "no objects of an abstract class may be created except
as objects representing a base class of a class derived from it".  new creates
an object (5.3.3).

Did the ANSI committee change the rules?


--
    John Carr (jfc@mit.edu)




Author: kanze@us-es.sel.de (James Kanze)
Date: 19 Nov 1993 13:50:04 GMT
Raw View
In article <rfgCGpGLF.6CA@netcom.com> rfg@netcom.com (Ronald F.
Guilmette) writes:

|> In article <CGAxuy.40z@cbnewse.cb.att.com> grumpy@cbnewse.cb.att.com (Paul J Lucas) writes:
|> >
|> > False.  *Objects* of abstract base classes may not be created,
|> > but pointers and references to them can be...

|> I am unaware of any restrictions which currently prohibit the creation of
|> objects having abstract types via `new' expressions.

ARM, section 10.3: "An abstract class is a class that can be used only
as a base class of some other class; NO OBJECTS OF AN ABSTRACT CLASS
MAY BE CREATED except as objects representing a base class of a class
derived from it."  (Emphasis added.)
--
James Kanze                             email: kanze@us-es.sel.de
GABI Software, Sarl., 8 rue du Faisan, F-67000 Strasbourg, France
Conseils en informatique industrielle --
                   -- Beratung in industrieller Datenverarbeitung