Article View: comp.std.c++
Article #413Re: "packed" objects
From: Ron Guilmette
Date: Fri, 24 Aug 1990 05:36
Date: Fri, 24 Aug 1990 05:36
37 lines
1986 bytes
1986 bytes
In article <56735@microsoft.UUCP> jimad@microsoft.UUCP (Jim ADCOCK) writes:
>In article <1227@lupine.NCD.COM> rfg@NCD.COM (Ron Guilmette) writes:
>|
>|The problem of packing across inheritance boundaries is a different
>|matter however...
>
>Okay, sounds interesting. How about a proposal about how this should
>work? I'd like to propose that your suggestion should still allow
>portability across machines with differing packing strategies, and should
>not be onerous to people who aren't interested in these details....
I could have sworn that I already *did* make a proposal. How about:
class base { int i; };
class derived : public packed base { int j; };
I'm assuming that the programmer might wish to specify exactly *which*
base class is supposed to get packed up against the fields of the derived
class.
Of course the example given above will never fly (politically) because it
introduces a new keyword. (God forbid :-) Of course you could always get
around that problem in the standard C++ way, i.e. by reusing yet another
existing keyword which should not be reused and by assigning it some new
and different meaning in one particular syntactic location. So how about:
class base { int i; };
class derived : public auto base { int j; };
It reads poorly, and it the meaning has nothing whatsoever to do with
auto'ness, but hey! It creates no new keywords! :-)
--
// Ron Guilmette - C++ Entomologist
// Internet: rfg@ncd.com uucp: ...uunet!lupine!rfg
// Motto: If it sticks, force it. If it breaks, it needed replacing anyway.
Technical Details
Message-ID:
<1312@lupine.NCD.COM>Path:
arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!mailrus!uunet!lupine!rfgReferences:
<56637@microsoft.UUCP> <1227@lupine.NCD.COM> <56735@microsoft.UUCP>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!mailrus!uunet!lupine!rfg From: rfg@NCD.COM (Ron Guilmette) Newsgroups: comp.std.c++ Subject: Re: "packed" objects Message-ID: <1312@lupine.NCD.COM> Date: 24 Aug 90 05:36:18 GMT References: <56637@microsoft.UUCP> <1227@lupine.NCD.COM> <56735@microsoft.UUCP> Organization: Network Computing Devices, Inc., Mt. View, CA Lines: 37