HDTenEightyP/NetNews huggingface dataset:
Path: pivot-sts!sbi!internet!psinntp!psinntp!uunet!brunix!brunix!sdm
   From: sdm@cs.brown.edu (Scott Meyers)
   Newsgroups: comp.lang.c++
   Date: 9 Oct 92 17:50:14 GMT
   References: <1b23cuINN26n@early-bird.think.com> <1992Oct09.141039.18062@watson.ibm.com> <DOUG.92Oct9093158@monet.ads.com>
   Sender: news@cs.brown.edu
   Distribution: comp
   Organization: Brown University Department of Computer Science
   Lines: 24

   In article <DOUG.92Oct9093158@monet.ads.com> doug@monet.ads.com (Doug Morgan) writes:
   | C++ guarantees all objects have nonzero size, therefore the nonzero
   | sizeof(Base).  I've never been able to completely follow the ARM's
   | statements about subobjects, but I suspect they somehow imply that
   | memory space for derived classes can't be reused for data members if
   | already set aside by a base class.  This and (probable) fullword
   | alignment requirements give the sizeof(Derived) = 8.

   This is contrary to my understanding of the situation.  I was under the
   impression that a compiler is allowed to play games such that

			 sizeof(Derived) = sizeof(Base)

   if either is empty.  (Actually, I thought that due to the strange rules
   governing layout of class members, this might even be true if neither class
   is empty.)  For the particular example being bandied about, I thought that
   it was possible for sizeof(Derived) = sizeof(int) because the padding
   character added to the Base class could be omitted for Derived objects.  Is
   this not true?

   Scott

   -------------------------------------------------------------------------------
   What do you say to a convicted felon in Providence?  "Hello, Mr. Mayor."

I see no reason why this could not be true.  However, I know of no C++
compiler which implements it.  I have two questions: 

For the standards folks:

	Could an implementation "special case" this "hidden member variable"
	when inheriting from an empty base class (when the derived class has
	its own data) without violating existing standards?

And for the C++ compiler implementors:

	How difficult would it be to do this?

--

--
        Richard W. (Dick) Kreutzer
Net:    rwk@quark.sbi.com				CIS:	70702,2174
Voice:  +1(801)571-2446					FAX:	+1(801)571-2448
Mail:   Integra Software Corp.; 1378 Jasmine Avenue; Sandy, UT 84092 (USA)

Newsgroups: comp.lang.c++
From: sdm@cs.brown.edu (Scott Meyers)
Subject: Re: Another Good C++ Book!
Organization: Brown University Department of Computer Science
Date: Mon, 12 Oct 1992 12:48:11 GMT

In article <Bw05GM.98B@fulcrum.bt.co.uk> rct@fulcrum.bt.co.uk (Richard Taylor) writes:
| In article <1992Oct10.152618.5182@cs.brown.edu> sdm@cs.brown.edu (Scott Meyers) writes:
| >
| >I'm glad you like the book.  There is currently a project at Brown
| >University that is working on the development of a lint++-like tool, but it
| >will offer much more power than lint, because you'll be able to write your
|             ^^^^^^^^^^^^^^^^^^^^^^^^^
| >own constraints and then have the system look for violations.  For more
| >information, take a look at this paper:
| >
| 
| See the pre- and post-conditions discussion elswhere in this newsgroup!

The discussion of pre- and post-conditions is relevant, but there is a
fundamental difference between that approach and the approach we are taking
with CCEL (the project at Brown): CCEL constraints are always statically
checked, while A++-like conditions are dynamically checked (but read the
A++ papers to see how it is sometimes possible to optimize such checks
away).  There is also a difference in flavor between the two approaches:
try saying something like "base classes must contain virtual destructors"
-- a straightforward constraint in CCEL -- using pre/post-conditions.  On
the other hand, CCEL can't say something like "after pushing something on a
stack, the stack in non-empty," but A++ can.

Scott


-------------------------------------------------------------------------------
What do you say to a convicted felon in Providence?  "Hello, Mr. Mayor."
Xref: sparky comp.lang.c++:14856 comp.std.c++:1373
From: bk19+@andrew.cmu.edu (Bradley D. Keister)
Newsgroups: comp.lang.c++
Subject: behavor of sizeof
Date: 16 Oct 92 08:14:10 GMT
Article-I.D.: andrew.ceridGO00WB=QHK1Zr
Organization: Physics, Carnegie Mellon, Pittsburgh, PA

I am trying to develop some code on a Connection Machine for which I need
to send objects from one processor to another as data in a "message".  The
syntax of the message call requires that I suppy the pointer to the
data and the number of bytes to be sent (received).  I can send builtin
types and plain structs, but I have serious troubles when I try to send
objects containing member functions.  I use the sizeof(classtype) as
the number of bytes.  I prepare the receiving processor for the message
by invoking "new" on a pointer of the appropriate type, which allocates
memory but doesn't initialize (because it doesn't yet have data from
the sending processor).  I then try to send a fully initialized object
from the sending processor, which contains intialized parameters but
no extra allocated memory.  For some reason, this doesn't work: I
get segmentation violations when I try to invoke member functions on
the receiving processor after getting the message.  One question is
then the behavior of the sizeof operator, because this determines what
is actually sent in a message.  My initial guess was that sizeof simply
computes the number of bytes in a data section, and does not include
functions, but it could easily be more complicated than that...

Please reply to the address below.

Brad Keister
Department of Physics
Carnegie Mellon University
Pittsburgh, PA 15213
(412) 268-2772 (office)
(412) 681-0648 (FAX)

internet:       keister@poincare.phys.cmu.edu
BITNET:         keister%poincare.phys.cmu.edu@CARNEGIE
Newsgroups: comp.lang.c++
From: nikki@trmphrst.demon.co.uk (Nikki Locke)
ReplyTo: nikki@trmphrst.35demon.co.uk
Subject: Re: virtual base classes
Distribution: world
X-Mailer: cppnews $Revision: 1.19 $
Organization: Trumphurst Ltd.
Date: Fri, 9 Oct 1992 19:35:52 +0000


In article <1992Oct9.112319.16876@cs.nott.ac.uk> gas@spitfire.xtel.co.uk (Alan Shepherd) writes:

> class foo: public virtual Object {...
> 
> class foo2: public virtual Object {...
> 
> When I try a statement of the following form:
> 
> Object* oneFoo2 = new foo2();
> 
> aFoo2 = (foo2) oneFoo2;
> 
> gcc complains like so:
> 
> cannot cast up from virtual baseclass `Object'
This behaviour is easiest to understand if you consider a probable 
implementation of virtual base classes. Derived classes of a virtual base 
class will have a pointer to the virtual base inside them. The base class,
though, does not have pointers to its derived classes (there may be 
hundreds of them). Thus it is possible to convert from Derived to Base 
(find the pointer, and return it) but not from Base to Derived (there is 
no pointer).

If you DON'T use virtual inheritance, the Derived class actually contains 
a copy of the Base class at a fixed offset (which is usually 0 for single 
inhgeritance). Thus you can upcast from base to Derived (merely subtract 
the fixed offset).

I suggest you read the C++ FAQ, which is bound to have a friendly, helpful
explanation of this.
---
Nikki Locke              |                        | nikki@trmphrst.demon.co.uk
Trumphurst Ltd.          | Tel: +44 (0)691-670318 | nikki@cix.compulink.co.uk
PC and Unix consultancy  | Fax: +44 (0)691-670316 | nikki@kewill.co.uk
trmphrst.demon.co.uk is NOT affiliated with ANY other sites at demon.co.uk.
Demon.co.uk is a dial-up subscription access point to the Internet.
Newsgroups: comp.lang.c++
From: tgimber@mdw.mitre.org (Tedd W Gimber)
Subject: Re: virtual destructors
Organization: Mitre Corporation, McLean, VA
Date: Tue, 13 Oct 1992 19:50:58 GMT

In article <1992Oct11.170052.26134@aplcen.apl.jhu.edu> ded@aplcen.apl.jhu.edu  writes:
>
>If one defines the following classes:
>
>class A {
>public:
>	~A()			{}
>	virtual void func()	{}
>};
>class B : public A {
>public:
>	~B()		{}
>	void func()	{}
>};
>
>Then runs the following code:
>
>	A* ptr = new B;
>	ptr->func();	// thanks to polymorphism, B::func() is called
>	delete ptr; 	// DAMNIT, A::~A() is called, not B::~B()
>
>It is natural to have a base class pointer point to several derived
>class instances.  Thus a "polygon" pointer can point to "squares,"
>"rectangles," "pentagons", etc.  However, when one wants to 
>delete this instance, it seems as if you have to cast the object
>to get the correct destructor.  This requires knowledge of the
>actual derived class involved.  I can think of ways to do this,
>but they all smell kludgy.
>
>I guess what I want is a virtual destructor.  Is there a way to invoke 
>destructors of derived types with a base class pointer (without casting)? 
>
>				me

Try this:

  virtual ~A() {};

This is a virtual destructor.  Sometime wishes come true :) .

Tedd
Newsgroups: comp.lang.c++
From: jimad@microsoft.com (Jim Adcock)
Subject: Re: Answers on a postcard...
Date: 14 Oct 92 23:00:14 GMT
Organization: Microsoft Corporation

In article <1425@swuts.sbc.com> sg3235@sw1sta.uucp (Stephen Gevers) writes:
|BTW, has anyone really used the
|comma operator for something useful???

I frequently use the comma operator in list classes where it has a useful
and intuitive meaning.
From: mccall@mksol.dseg.ti.com (fred j mccall 575-3539)
Newsgroups: comp.lang.c++
Subject: Re: Borland 3.1 nested comment highlighting problem.
Date: 8 Oct 92 15:58:21 GMT
Article-I.D.: mksol.1992Oct8.155821.12602
Organization: Texas Instruments Inc

In <1160@ncrspks.SparksNV.NCR.COM> karl@ncrspks.SparksNV.NCR.COM (Karl Held) writes:

>My apologies if this topic has already been covered. Highlighting of nested
>comments under Borland C 3.1 does not extend beyond the innermost comment.
>Everything between the initial comment and the end of the most nested comment
>is properly highlighted. The rest of the comments beyond the innermost comment
>is not highlighted. Is anyone aware of a patch to fix this problem? Please
>respond by email, if possible. Thanks in advance.

It's highlighting the comment (from start of comment to first close of
comment).  Comments don't nest unless you explicitly turn on the
switch to allow it (which is, IMHO, a terrible idea).  The 'fix' for
this 'problem' is to not nest comments.

-- 
"Insisting on perfect safety is for people who don't have the balls to live
 in the real world."   -- Mary Shafer, NASA Ames Dryden
------------------------------------------------------------------------------
Fred.McCall@dseg.ti.com - I don't speak for others and they don't speak for me.
From: Ken.Yap@f1.n100.z60.wlink.nl (Ken Yap)
Newsgroups: comp.lang.c++
Subject: Question: Can I embed SQL in C++
Date: Tue, 13 Oct 1992 07:06:45 -0100

Organization: CSIRO Division of Info Tech, Sydney, Australia

There's one thing you should be careful with and that is the C++
comment syntax.  In particular don't do this:

	C++ code
//***********************************
//***********************************
	more C++ code

The SQL preprocessor thinks this is the start of a C comment and loses
a lot of code.

We bumped into this a while back.

Newsgroups: comp.lang.c++
From: valerio@cpsc.ucalgary.ca (Valerio Franceschin)
Subject: pointers to objects/member functions
Organization: University of Calgary Computer Science
Date: Fri, 9 Oct 1992 23:12:19 GMT


Hi,

I want to set up a list of event records with 2 fields, the first is a pointer to
an object and the second is a pointer to a member function of that object.
I would then like to read back this information so as to invoke the member of
the corressponding object. I did it the following way, but keep getting compilation 
errors at the lines indicated. 

Can anyone see what am I doing wrong?  Any help would really be appreciated.  Please
send all replies to me directly.

thanks,
V


CC t.c
CC  t.c:
"t.c", line 34: error: bad object type in .* expression:  A * (B * expected)
"t.c", line 37: error: bad object type in .* expression:  A * (B * expected)
2 errors



#include <stdio.h>

class A {
    public:
        void fa() { printf("A::f()\n"); }

};

class B : public A {
    public:
        void fb() { printf("B::f()\n"); }
};

struct event {
    A    *object;        // pointer to an object
    void (B::*member)(); // pointer to its member, 
                         // I would think this should be (A::*member)() ???
};
    
main() {
    A *a, *obj;
    B *b;
    event e1;
    event e2;

    a = new A;
    b = new B;

    e1.object = a;
    e1.member = &A::fa;

    e2.object = b;
    e2.member = &B::fb;

    obj = e1.object;
    (obj->*e1.member)();  // this is line 34

    obj = e2.object;
    (obj->*e2.member)();  // this is line 37
}

Newsgroups: comp.lang.c++,comp.lang.c
From: bell@monu6.cc.monash.edu.au (Mr G.A. Bell)
Subject: help re-menus in C/C++ for TurboVision
Followup-To: poster
Keywords: help menus c++ turbovision
Organization: Monash University, Caulfield Campus
Date: Wed, 14 Oct 1992 00:55:40 GMT


hello netter,

Please help. Can anyone supply source for menus in TurboVision (in C).

I have read the Manual and can not get it to do what I need it to do.

Firstly 

Having a Top level menu without a submenu 

and Secondly

Having a submenu within a submenu.

I know that TMenuItem and TSubMenu have overload operators
but I can not seem to get the syntax correct for what I want.

Any help would be greatly appreciated

Thanks,

Gary

-- 
``````````` bell@monu6.cc.monash.edu.au `````````````````````````````````````
| Gary Bell                                                                   |
| Department of Robotics and Digital Technology                               |
|Faculty of Computing, Caulfield Campus, Monash University, Australia         |
Newsgroups: bnr.lang.c++,comp.lang.c++
From: dak@tabaqui.informatik.rwth-aachen.de (David Kastrup)
Subject: Re: Reassigning this.
Organization: Rechnerbetrieb Informatik  /  RWTH Aachen
Date:  9 Oct 92 18:00:50 GMT

gbluhm@galapagos.East.Sun.COM (Gerald Bluhm - Sun USOPS IR) writes:


>   I've been slowly going through the "C++ Primer", 2nd Edition, by
>Lippman, and I have a question regarding the example on p.237 which
>demonstrates in the member function Screen::reSize(int, int, char) how
>you can replace an invoking object with a new object by overwriting
>*this.

>   In this example, a new Screen object is created with new, and *this
>is reassigned to the the new object, leaving the old one dangling.
>(There's a "delete screen" statement in there, but screen is just a
>char * member of the Screen class, not a Screen instance.)

>   Is this considered good practice?

>   Is it possible to first assign another pointer to the invoking 
>object before reassigning *this, and then you delete the invoking 
>object:

>..
>	Screen *oldps = *this;
>	*this = *ps;	// replace Screen object
>	delete oldps;
>	return *this;
>}

>   Or, am I missing something?

You are. *this isn't a pointer. It is the structure being initialized
by the constructor. So Assignment to this does change all of your
structure, but not its location. You could not assign *this to a pointer,
because *this is not a pointer. Although complete copying of a parent
structure may seem weird (to me it does), it is quite possible, as
long as there is a generated copy constructor. You have to look
out for unwanted recursion if you define a copy constructor in the
form above.
From: hartman@ulogic.UUCP (Richard M. Hartman)
Newsgroups: comp.lang.c++
Subject: Re: declare keyword, type inference
Date: 13 Oct 92 00:47:51 GMT
Organization: negligable

Since when is "not confusing" an objective?

Take "const"

File source.C:

const float pi=3.14;

class x {
...
public:
	const char const *func(const int &r) const;
}

it means:
	float "pi" cannot be changed

	parameter "r" cannot be changed

	member function func() may be used by "var", if declared
	  as "const x var;"

	member function func() will not change internal values
	  of the class;

	member function func() will return an unchangable pointer
	  to an array of char which is also unchangeable.

Did I even get these right? The first two are the same.  
The third and fourth are each different meanings.  The third 
is related to the first but the syntax for "an unchangeble pointer 
to changeble data" (char const *) and "a changeble pointer to 
unchangeble data" (const char *)  (did I get those right?) gets 
confusing, and of course you can team 'em up to make it look worse
than it is	 ;)

I think that changing the meaning of "auto" to something
like what has been discussed above would be useful.  And
whether it is "confusing" or not shouldn't be the primary
concern.  We should check to see how much code it would
break (as pointed out not much) balanced with how useful
the change would be (a matter of opinion to be hashed out).

		-Richard Hartman
		hartman@ulogic.COM

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
"186,000 mi/sec.  Not just a good idea, it's the LAW!"

Newsgroups: comp.lang.c++
From: jordi@sc2a.unige.ch
Subject: Garbage collection FAQ file ???
Organization: University of Geneva, Switzerland
Date: Thu, 8 Oct 1992 07:48:25 GMT

Hello,
I just would like to know if there is a FAQ file on Garbage Collection ?
If yes, where can I get it ?

Thanks for any help!

Sincerely,

Steve Jordi                

+-------------------------+----------------------------------------------+
| Dpt of Geophysics       | Fax: + 41 22 320-5732                        |
| University of Geneva    |                                              |
| 13, Rue des Maraichers  | E-Mail: Internet:   jordi@sc2a.unige.ch      |
| 1211 GENEVA 4           |         Bitnet:     jordi@cgeuge52.bitnet    |
| Switzerland             |         Compuserve: 70143,3056 (once a week) |
+-------------------------+----------------------------------------------+
From: barmar@think.com (Barry Margolin)
Newsgroups: comp.lang.c++
Subject: Re: Standard for Class Information?
Date: 15 Oct 1992 15:35:57 GMT
Organization: Thinking Machines Corporation, Cambridge MA, USA
NNTP-Posting-Host: telecaster.think.com

In article <djd.719140842@reading> djd@csug.cs.rdg.ac.uk writes:
>I was sitting here thinking how class browsers might work, and wondered
>if C++ compilers should be able to produce a file containing class
>descriptions according to a _standard_ format.  This would remove the
>necessity for class browsers to be able to parse C++ code, and be
>completely decoupled from dialect and compiler.
>
>Does anyone know of any proposals in this vein?

I believe Lucid is trying to get the industry to adopt a standard for the
representation of class information in the debug information of object
files.  This is necessary for advanced programming environments (like their
Energize and Centerline's CodeCenter) to be able to display data
intelligently, debug member functions, etc.
-- 
Barry Margolin
System Manager, Thinking Machines Corp.

barmar@think.com          {uunet,harvard}!think!barmar
From: joe@Veritas.COM (Joe Fasano)
Newsgroups: comp.lang.c++
Subject: C++ test cases
Summary: Finding C++ testcases
Keywords: C++ testing
Date: 16 Oct 92 22:19:13 GMT
Distribution: comp.lang.c++ comp.std.c++
Organization: VERITAS Software

I am writing a C++ parser and I would like to 
make sure that I can parse all the examples in
The Annotated C++ Reference Manual by Ellis and Stroustrup.

Does anyone know where I could get online versions of 
all the examples in the ARM ?

joe@veritas.com



-- 
	-------------------------------------------------------------
	joe			ARPAnet:  veritas!joe@apple.com
	joe@veritas.com		UUCPnet:  {apple,pyramid}!veritas!joe
From: haines@CS.ColoState.EDU (Matt Haines)
Newsgroups: comp.lang.c++
Subject: Reference for M++ wanted
Date: 14 Oct 92 22:47:00 GMT
Article-I.D.: yuma.Oct14.224700.93460
Organization: Colorado State University, Computer Science Department

Hello all.

I would appreciate any references for the M++ or P++ extensions to the 
c++ language.  M++ is a set of classes for arrays, and P++ is an 
extension of M++ that also handles thread scheduling.

Please e-mail the responses, and I will post a summary if there is
sufficient interest.

Thanks in advance.

Matt

-- 
Matt Haines                 | <haines@cs.colostate.edu>
Computer Science Department |
Colorado State University   | "Why waste time learning when ignorance is
Fort Collins, CO  80523     |  instantaneous"                   - Hobbes
Newsgroups: comp.lang.c++
From: pankert@waggonlix.informatik.rwth-aachen.de (Matthias Pankert)
Subject: ObjectCenter with NIHCL ?
Summary: ObjectCenter C++ with NIHCL ?
Keywords: NIHCL, ObjectCenter, software project
Organization: Rechnerbetrieb Informatik  /  RWTH Aachen
Date: 15 Oct 92 12:49:30 GMT

Does anybody use the ObjectCenter C++ for a software project based on 
NIHCL (possibly a large project consisting of 100k lines of code)?
Are there any problems porting such a project from Sun CC 2.1 to
ObjectCenter C++? Can ObjectCenter handle 200k symbols? Are there any
hints?

Matthias Pankert


Aachen University of Technology, 5240 ERT (Aachen, Germany)
Tel. +49 241/80-7887, Fax +49 241/80-7631
INTERNET: pankert@ert.rwth-aachen.de
-- 
Matthias Pankert
Aachen University of Technology, 5240 ERT
Tel. +49 241/80-7887, Fax +49 241/80-7631
INTERNET: pankert@ert.rwth-aachen.de
Newsgroups: comp.lang.c++
From: newkerk@zso.dec.com (Oscar Newkerk)
Subject: Re: Looking for SQL class library
Reply-To: newkerk@zso.dec.com
Organization: Digital Equipment Corporation
Distribution: usa
Date: Thu, 8 Oct 1992 23:28:36 GMT



Qualix sells a package called db++ that might fit your needs.

Qualix Group Inc.
1-800-245-UNIX

or you can try mail to info@qualix.com
Newsgroups: comp.lang.c++
From: wirth@faw.uni-ulm.de (Ruediger Wirth)
Subject: inference machine embedded in C++
Followup-To: peter@fuzi.uucp
Organization: FAW (Research Institute For Applied Knowledge Processing, Ulm, Germany)
Date: Mon, 12 Oct 1992 17:06:52 GMT

I am posting this for a friend.
Please send all follow ups to peter@fuzi.uucp.