🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: Object in this mirror may appear smaller than they are

#714
From: Nathan Myers
Date: Fri, 16 Oct 1992 19:26
18 lines
1248 bytes
Regarding inheritance from empty classes,
Given
  class A { /* empty */ };
  class B : A { int stuff; }
The language definition requires sizeof(A) > 0 but it does not
require sizeof(B) > sizeof(int).  Arguably, a compiler that does
is just broken.

I often want to declare an empty class just to define
enums and static functions for use by a family of classes; as it is,
I must not derive my other classes from it, and must use name
qualification everywhere; and all the members must be public.

Are there any compiler vendors reading this whose compiler is not broken
in this way?

Nathan Myers
myersn@roguewave.com
Technical Details
Message-ID: <Bw8BCz.17t@news.orst.edu>
Path: arc1-ca.pugleaf.net!sparky!uunet!know!mips2!cass.ma02.bull.com!think.com!sdd.hp.com!uakari.primate.wisc.edu!caen!sol.ctr.columbia.edu!The-Star.honeywell.com!umn.edu!news.orst.edu!hobo.ECE.ORST.EDU!myersn
References: <RWK.92Oct7181545@silver.sbi.com> <23846@alice.att.com>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!sparky!uunet!know!mips2!cass.ma02.bull.com!think.com!sdd.hp.com!uakari.primate.wisc.edu!caen!sol.ctr.columbia.edu!The-Star.honeywell.com!umn.edu!news.orst.edu!hobo.ECE.ORST.EDU!myersn
From: myersn@hobo.ECE.ORST.EDU (Nathan Myers)
Newsgroups: comp.std.c++
Subject: Re: Object in this mirror may appear smaller than they are
Message-ID: <Bw8BCz.17t@news.orst.edu>
Date: 16 Oct 92 19:26:56 GMT
References: <RWK.92Oct7181545@silver.sbi.com> <23846@alice.att.com>
Sender: usenet@news.orst.edu
Distribution: comp
Organization: ECE Dept.,OSU,Corvallis
Lines: 18
Nntp-Posting-Host: hobo.ece.orst.edu