HDTenEightyP/NetNews huggingface dataset:
From: davidm@consilium.com (David S. Masterson)
Newsgroups: comp.lang.c++
Subject: Re: DEC C++ right or wrong on member pointer construct?
Date: 31 Jul 92 17:57:28 GMT
Organization: Consilium Inc., Mountain View, California
In-reply-to: whm@sunquest.UUCP's message of 29 Jul 92 07:47:51 GMT
X-Posting-Software: GNUS 3.13  [ NNTP-based News Reader for GNU Emacs ]

>>>>> On 29 Jul 92 07:47:51 GMT, whm@sunquest.UUCP (Bill Mitchell) said:

->     class Base {
-> 	};

->     class Derived: public Base {
-> 	};

->     class U {
->       public:
-> 	Derived d;
-> 	};

->     struct Bp {
-> 	Base U::*a;
-> 	};

->     struct Bp Bpmap[] = {
-> 	&U::d,  // error?
-> 	0
-> 	};

Something does seem right about this code (there's a lot missing from it).
How can you initialize Bpmap to the address of the *declaration* of U?
--
====================================================================
David Masterson					Consilium, Inc.
(415) 691-6311					640 Clyde Ct.
davidm@consilium.com				Mtn. View, CA  94043
====================================================================
"Bill Gates says no matter how much more power we can supply, he'll develop 
 some really exciting software that will bring the machine to its knees."
-- Intel VP David House, In _EE_Times_, 16 October 1989
From: bright@nazgul.UUCP (Walter Bright)
Newsgroups: comp.lang.c++
Subject: Re: Power Operator vs NANs
Date: 23 Jul 92 00:39:51 GMT
Reply-To: bright@nazgul.UUCP (Walter Bright)
Organization: Zortech, Seattle

In article <1992Jul21.204639.2327@u.washington.edu> rons@hardy.u.washington.edu (Ronald Schoenberg) writes:
/I'm not sure I understand - why is better to leave the effect of NaN's
/on operator == undefined?  Why do you see NCEG as losing battle? 
/What do you really have against adding features that would benefit
/people like me who are doing numerics programming?  Your note seems to
/assume that I would know why "it's not time to leave behind non-IEEE
/floating point.  What exactly do non-numerics programmers have to lose
/with IEEE floating point?  Maybe Walter Bright could tell us what the
/reaction is to Zortech C++.

From the people who do numerics for a living, the reaction is typically
"thank god, this is what we've been waiting for".

/Is there a deluge of criticism from
/non-numerics programmers?

None at all.

/Or maybe they aren't even aware of (and
/don't care about) the NCEG extensions.

That seems to be the case. The NCEG extensions are clean in that they
have no perceptible impact on non-numeric programming.

P.S. There is one exception to all this. Doing IEEE arithmetic involves,
in some cases, generating a bit more code. Some magazine benchmark
reviewers have naively (and sadly) commented that Zortech's floating point
has slowed down a bit. To address this "problem" the next version will
sport the -ff switch, which will generate "fast" 8087 code, which does
not worry about correct NAN handling.
From: KOSU_MATSB@ROUTH.KOSUFY.LU.SE
Newsgroups: comp.lang.c++
Subject: Having this=0, class-name::main() and tasking in c++
Date: 26 Jul 92 02:31:19 GMT
X-Unparsable-Date: Sun, 26 Jul 92 04:38 GMT+02

Two (three) questions on C++:

Question #1:	Having a 0 "this" pointer. Standard?
	If i happen to use a method using an explicit pointer to 
	an object which for some reason of another happens to be 
	0 (which i probably don't want to do ;-) i have noticed 
	that G++ (ver 2.2.2 for VAX/VMS) get's a bit carried away 
	when the method starts to access the items of the object.
	However, it is possible to catch this since the "this" 
	pointer is 0 and a controlled exit is possible. If the 
	method is virtual the program crashes at the call
	(naturally). Is this of a 0 "this" pointer in a method
	within the standards of C++ or a feature of G++?
	(i.e. can i use the feature in a program and expect it to
	work on another type of machine and copmiler?)
	

Question #2:	class_name::main() & coroutines/threads/tasks in C[++]
	Reading the newsgroups "comp.lang.c++" and "comp.std.c++" 
	i get the impression of some developement of the language.
	Since i am not alltogether unexperienced in MODULA-2 and 
	(as You might have guessed by these questions) just 
	recently started with C++ i miss two of the best parts in
	MODULA-2.

	a; Im M2 each implementation module have a part 
	initializing the module. A similar opportunity to 
	initialize a class would be a very powerful tool.
	The to me natural choise for such a tool would be
	"int class_name::main()" (the program would terminate
	if the return value != 0). I know it is quite simple to 
	simulate this in C++, but a standard would be cleaner.
	I know there are problems if a class initialiser uses a
	class depending of being initialized but not yet so...

	b; The M2 coroutine/task concept is VERY powerful when
	making asynchonic programs. Are there any plans to 
	incorporate this in C++/C?


		Sincerely/Mats Bergstrvm.
 -----------------------------------  -----------------------------------
 Mats Bergstrvm                       mats.bergstrom@kosufy.lu.se
 Div of Cosmic and Subatomic Physics  kosu_matsb@130.235.92.17
 Department of Physics                ROUTH::KOSU_MATSB (ROUTH::=57412::)
 University of Lund                   Phone: (+46)104767
 SWEDEN.                              Fax:   (+46)104709
 -----------------------------------  -----------------------------------
From: dwo1@gte.com (Donald W. Ottens)
Newsgroups: comp.lang.c++
Subject: tutoring and test
Keywords: tutor
Date: 29 Jul 92 15:57:28 GMT
Distribution: usa
Organization: GTE Laboratories Incorporated, Waltham MA


Looking for some c++ tutoring, due to a heavy schedule that I have.

Willing to pay a $ rate, as negotiated.

Tutoring is only for this week and maybe next week.  About  a couple
hours per week.

Please call me at work:  617 466-2071
home (but I'm never there)  617 646-8402

Will be at work tonight.

Also, this is a test message (I sent one before and never saw it posted),
so could somebody simply respond by 2PM to say they read it, at least.

thank you very much.

don ottens
dwo1@gte.com
Newsgroups: comp.lang.c++
From: steve@taumet.com (Steve Clamage)
Subject: Re: Renew?
Organization: TauMetric Corporation
Date: Mon, 27 Jul 1992 17:30:54 GMT

de@cray.com (Duane Eitzen) writes:

>>There is also the problem that it is potentially very difficult to
>>implement in a C-based environment if it is required to use realloc.
>>The trouble is that you can't tell whether realloc will move something
>>until after it's too late.

>To restate the problem: if your C++ is actually just a C++ to C translator,
>you can't use realloc() in your implementation of renew.

This seems completely irrelevent to me.  No matter whether you use C
as an intermediate language, a 'renew' operator cannot be defined in
the language specification in terms of realloc.

There is no requirement that 'new', for example, have any relationship
whatever to 'malloc' or 'realloc'.  Either might be implemented in
terms of the other, or they might be independent implementations.  They
might even manage different address spaces.  You therefore could not
specify the semantics of renew in terms of realloc.

Implementation is a different question.  The implementor(s) of the C
and and C++ runtime libraries must follow the language/library
specifications.  In a given implementation it might be possible to
use realloc in implementing renew; in another it might not.  This
would depend on the specification of renew and on the implementation
of realloc.  Since we don't have a specification for renew, we can't
really say much more than that.

>On the topic of submitting a proposal: how does one do this? How
>much time should one expect to spend doing it? What percentage of
>external proposals are successful?

These questions are answered in the article "How to Write a C++
Language Extension Proposal", printed in C++ Report for May 1992,
and in ACM SigPLAN Notices for June 1992.
-- 

Steve Clamage, TauMetric Corp, steve@taumet.com
Vice Chair, ANSI C++ Committee, X3J16
Xref: sparky comp.lang.c++:11759 gnu.g++.help:1059
From: purtill@idacrd.UUCP (Mark Purtill)
Newsgroups: comp.lang.c++,gnu.g++.help
Subject: Re: porting to g++ (from other "dialects")
Date: 29 Jul 92 22:21:06 GMT
Organization: idacrd, princeton, nj

jbuck@forney.berkeley.edu (Joe Buck) writes:
>2.  The template implementation is still buggy, but it's been improving
>rapidly (2.2.2 is much better than 2.1).  g++ doesn't implement the cfront
>hack that lets you declare template functions in Foo.h and define them in
>Foo.c, and then do a hidden #include of Foo.c so everything will work.  If
>you do this in g++ you'll need to #include "Foo.c".

	That isn't actually quite how cfront works.  What it does is
generate a small file along the lines of:

	#include "Foo.h"
	#include "Foo.c"
	static Foo<int> _dummy_ ;

and then compiles THAT, so as to generate one copy of all of the
relevant functions.  This means, for instance, that "Foo.h" had better
not depend on anything else having been included before it, and that
you have to pass all the cpp/cfront/cc flags to the load phase (since
that's where the small file is generated and compiled).  In practice,
this all seems to be not worth the effort (especially when class Foo
is declared in "Bar.h" and defined int "Bar.C" and "Bar2.C", when you
have to start messing around with configuration files to tell the
template linker thingee where everything is).  It's especially fun
when you want the same code to compile under gcc as well....

^.-.^ Mark Purtill, purtill@ccr-p.ida.org; uunet!idacrd!purtill. (609)497-0526.
((")) \@_: IDA/CCR-P, Thanet Road, Princeton NJ 08540;           (609)924-4600.
Newsgroups: comp.lang.c++,comp.std.c++
From: jss@lucid.com (Jerry Schwarz)
Subject: Re: run-time type checking (was: Re: Covariant Types in Derived Classes)
Reply-To: jss@lucid.com (Jerry Schwarz)
Organization: Lucid, Inc.
Date: Sat, 25 Jul 92 02:21:47 GMT

In article <1992Jul24.192207.15267@ucc.su.OZ.AU>, maxtal@extro.ucc.su.OZ.AU (John MAX Skaller) writes:
|> 
|> 	But that wont PROVE anything. You have to give me
|> an example of a system that uses downcasting and then I'll
|> show how to write it without downcasting.
|> 
|> 	Please restrict examples to domestic systems, since
|> I already agree all bets are off for foreign systems and
|> also for introspective ones like, say, debuggers, OODBMS,
|> etc.
|> 
|> 	Lets agree for example to restrict ourselves to
|> text input and output and no disk storage. Lets agree
|> that the program must handle a fixed number of types.
|> And that it reads text in, does some calculations,
|> and then prints the answers.
|> 
|> 	Such a program creates ALL the objects, manipulates
|> them, and then it terminates.
|> 

Here is a typical example of my use of downcasting. Downcasting
is not essential in this example, but I think it makes the design
cleaner.

I want to define an "indent stream" derived from ostream.
An indent stream contains an indentation level.  

class indentstream : public ostream {
   public:
    int level ;  // Public only to keep example short.
    indentstream(streambuf* sb) : ostream(sb), level(0) { }
} ;

The level is used by a manipulator.

ostream& newline(ostream& os) {
    indentstream* is = CAST<indentstream*>os ;  // notation suggestive
    os.put(\n) ;
    if ( is ) {
        for ( int n = 0 ; n < is->level ; ++n ) is.put('\t') ;
    }
    os.flush() ;
}

Typical uses look like

     indentstream myout(...) ;
     ...
     myout.level++ ;
     // x and y inserters do not have to understand indentation as long
     // as they put everything on a single line.
     myout << x << newline << y << newline ;
     myout.level--

This class isn't perfect, but I hope you get the idea.  More elaborate
methods can be devised that put the newline detection in the
streambuf and avoid newline.  These also require downcasting so
that you can be sure the streambuf is the right type before you tell
it to change level.

|> >
|> >>	Inother words, in a *domestic* system, any apparent 
|> >>need for downcasting should be used as an indicator of flawed design.
|> >>

indentstream can be done without derivation and without downcasting by use
of the iword facility of streams, but that feature of streams is generally
regarded as baroque and unappealing.  It was included in the stream
interface precisely because safe downcasting wasn't available.  
People frequently just go ahead and use an unsafe cast in "newline"
(or its equivalent).  

   -- Jerry Schwarz
From: gordie@duts.ccc.amdahl.com (Gordon Freedman)
Newsgroups: comp.lang.c++
Subject: Question: How to get fd from cin?
Date: 25 Jul 92 01:24:06 GMT
Reply-To: gordie@duts.ccc.amdahl.com
Organization: Happy hacker bait and tackle shop

How do I get the integer fd for cin (or any iostream for that matter)? I want
to use it for XtAddInput and/or select system call.

Thanks in advance,

---
Gordon Freedman: gjf00@duts.ccc.amdahl.com OOPs, did I code that?
Newsgroups: comp.lang.c++,comp.std.c++
From: jrobie@netmbx.netmbx.de (Jonathan Robie)
Subject: Re: Language extensions for run-time type identification
Organization: netmbx, Berlin, Germany
Date: Tue, 21 Jul 1992 10:34:36 GMT

pathak@mitre.org (Heeren Pathak) writes:

>In article <EY048MK@netmbx.netmbx.de>, jrobie@netmbx.netmbx.de (Jonathan
>Robie) wrote:
>> 
>> shang@corp.mot.com (David (Lujun) Shang) writes:
>> 
>> >The language should provide run time type checking as well as array bounds  
>> >checking. You can also have a switch to turn off them if you like to.
>> >  
>> 
>> It may be important for compilers to provide such a switch since the
>> memory overhead needed to store type information for all classes can
>> be significant.  Pragmas would be necessary to switch it on and off
>> since you might need it for some classes but not for others....messy,
>> isn't it?
>> 

>Why not use MI to provide a "standard" mix-in class that provides run-time
>identification?  

I assume you mean that this class would give access to the run-time
identification provided by the compiler, right?  That might make sense,
but I don't like the idea of making the compiler look at the derivation
tree to see whether it should generate run time identification.

Obviously, no class is going to be able to generate run time identification
for objects including it or derived from it.  How should it know the
relevant types?


Jonathan

===========================================================================

Jonathan Robie		jrobie@netmbx.UUCP
Arnold-Zweig-Str. 44	jrobie@netmbx.in-berlin.de
O-1100 Berlin		
Deutschland		Phone:  +37 (2) 472 04 19  (Home, East Berlin)
				+49 (30) 342 30 66 (Work, West Berlin)


-- 
Jonathan

===========================================================================

Newsgroups: comp.lang.c++
From: zen@syl.dl.nec.com (zen kishimoto)
Subject: C++ and Smalltalk
Summary: Need to find out a rough breakdown of OO programmers
Keywords: Smalltalk C++
Organization: NEC Systems Lab., C&C Software Technology Center (Dallas, TX)
Date: Wed, 22 Jul 1992 18:46:41 GMT

My boss will give a presentation next month. He asked me to
get some information.  That is how many percentages of oo programmers
program in C++ and in Smalltalk.  I got a figure somewhere but lost
it.  It was something like C++ 70% and Smalltalk 20%.  Is there any
paper or something I can refer to?

Any information which leads me to that information is greatly
appreciated.  Please e-mail me to zen@syl.dl.nec.com.
Thanks in advance.

Zen Kishimoto 
-- 
-----------------------------------------------------------------
Zen Kishimoto          C&C Software Technology Center (CSTC)
	       NEC Systems Laboratory, Inc.
		       1525 Walnut Hill Lane Irving, Texas 75038
Newsgroups: comp.lang.c++,comp.std.c++
From: mat@mole-end
Subject: Re: Language extensions for run-time type identification
Organization: :
Date: Tue, 21 Jul 1992 09:42:04 GMT

In article <1992Jul20.220534.1365@cadsun.corp.mot.com>, shang@corp.mot.com (David (Lujun) Shang) writes:

> I sencond this. As I already said, run time type checking of classes
> only with virtual functions is not a serious solution.
 
> David Shang

Let's be sure that we are talking about the same thing, then I'll ask you
to refute an assumption underlying the current proposal.

The current proposal would allow a number of things, including at least
checked downcasting and some kind of comparison-for-equality of the exact
type of objects.

There are many bad uses for these facilities, but there are also good
uses, or so it is believed.

The assumption underlying the decision to include only classes with
virtual functions is that a class that has no polymorphic behavior
whatsoever (not even a virtual destructor) cannot be used in any way
that is both safe and interesting even with the proposed runtime type
support.  Can you refute this assumption?
-- 
 (This man's opinions are his own.)
 From mole-end				Mark Terribile

 uunet!mole-end!mat, Somewhere in Matawan, NJ
From: ser@netcom.com (Steve Rubin)
Newsgroups: comp.lang.c++
Subject: Good book C -> C++
Date: 28 Jul 92 03:19:56 GMT
Organization: Netcom - Online Communication Services  (408 241-9760 guest)


Does anyone have any suggestions on a book for moving from C to C++?  Ive
looked at C++ for C programmers by Pohl and it looks like a winner.  Any
insight?
-- 
___________________________________________________________________________
Steve Rubin			    ser@netcom.com, support@netcom.com
Technical Support Staff             Netcom - Online Communication Services
From: bcannard@hppcb36.mentorg.com (Bob Cannard @ PCB x5565)
Subject: Re: Design of Constructors
Originator: bcannard@hppcb36
Date: Fri, 31 Jul 1992 01:10:11 GMT
Organization: Mentor Graphics 
Keywords: 
Followup-To: 


horvath@granite.ma30.bull.com (John Horvath) writes:
> Executive summary: If constructors can't return values, is it their intent
> they should not try to do anything that can fail?

No, the idea is that they throw an exception if they fail. Pity it's taking so
long for the blasted things to get implemented...

Cheers and much patience,

		Bob.
-- 
bob_cannard@mentorg.com         "Mr. Cthulhu? This is your wake-up call..."
Exprssed opinions are not necessarily those of Mentor Graphics Corporation.
Newsgroups: comp.lang.c++
From: steve@taumet.com (Steve Clamage)
Subject: Re: virtual madness - problem with virtual base class
Organization: TauMetric Corporation
Date: Sat, 25 Jul 1992 15:57:30 GMT

ik@snoopy.ctt.bellcore.com (Ik Su Yoo) writes:

>I'm using cfront 2.1 with ObjectCenter 1.1 and having problem with the
>following code:  [ condensed ]

>    class A {
>    public:
>      virtual void f();
>    };

>    class B: public virtual A { };

>      B bb;
>      void* bbp = &bb;
>      ((B*)bbp)->f();
>      ((A*)bbp)->f();

Pointer casts in C++ do not in general mean "copy the bits".  When a
class hierarchy is involved, the compile-time type is taken into
account to adjust the pointer value.  When you cast &bb to type void*,
you lose all the compile-time type information.

For example, when a B* is cast to an A*, there is a value change.
The A base class does not start at the same address as the B derived
class -- a virtual base must be located somewhere else.  The compiler
generates code to adjust the address to the start of the A object.

In your example, you take the address of a B, cast it to void*.  Then
you take the void* and cast it to type A*.  The information that the
address is really of a B was lost to the compiler, so it can't make the
adjustment.  You take the address of the B and try to use it as though
it were the address of an A, which it is not.
-- 

Steve Clamage, TauMetric Corp, steve@taumet.com
Vice Chair, ANSI C++ Committee, X3J16
Newsgroups: comp.lang.c++
From: mickey@sfera.kharkov.ua (Mickey Serg Antonoff)
Subject: Re: Protogen Code Generator
Organization: PC Center TECHNO (Kharkov BB)
Date: Wed, 29 Jul 1992 14:30:58 GMT

twpunix@bsu-cs.bsu.edu (Tim Parsons) writes:


>  Having recently registered my Borland C++/AF 3.0, I got a call from a 
>Borland rep offering Protogen for $49.95 (regularly $495, she said).
>Does anyone know if it's worth getting, what it's particularly suited for?
>It'd have a money-back trial period, but I'd like to know if it's something
>to seriously look into, before I make even such a modest leap.  I've scanned
>back issues of PC Week, etc., but info is pretty sketchy.  Thanks.

>Tim Parsons (twpunix@bsu-cs.bsu.edu)

  Hi !

 I guess, that if You plan to do a serious work then You have nothing to do
with it, 'cause it is (as the most of such environment) too simple to do
smth. larger than 
main()
{
	printf( "Hello world !!" );
}

	With the best wishes,
				Mickey <mickey@sfera.kharkov.ua>
From: brendan.woithe@f820.n680.z3.fido.zeta.org.au (Brendan Woithe)
Newsgroups: comp.lang.c++
Subject: Cost of compiler
Date: 19 Jul 92 17:38:05 GMT
Organization: Fidonet. Gate admin is fido@socs.uts.edu.au

Well. . .Hello there!!!

I'm just wondering how much people pay for C++ compilers. I've heard them
costing up to 1200 big ones, with toolboxes. Is that about average???

And anyone in AMERICA - How much do you guys get it for
   (in Australia everything is expensive)

Jhagon strikes once again.

BLW


--- Blue Wave/RA v2.10 [NR]
 * Origin: Coffee Au Go-Go. We don't know what it means either.
(3:680/820.0)
Newsgroups: comp.lang.c++
From: losaccom@cs.rpi.edu (Mark LoSacco)
Subject: _new_handler????
Organization: Rensselaer Polytechnic Institute
Date: Wed, 29 Jul 1992 20:19:24 GMT


   I was hoping someone here might be able to help me out.
I am using the latest g++ compiler, and am trying to set the
supposed system variable "_new_handler" to point to a function
that will be called whenever an out-of-memory error occurs.

   I say supposed because when I try to compile it, I get the
message: Undefined symbol __new_handler referenced from text
segment.  

   My code looks like this...

   extern void ( *_new_handler )();

   main()
   {
      _new_handler = &out_of_memory;

      ...etc
   }

   void out_of_memory()
   {
      <print error message & terminate>
   }


   Since I am following directly from a C++ book I have,
I suspect that g++ knows this system variable under a 
different name.

   Can anybody help me out on this one?

				Thanks,
				Mark 
				losaccom@cs.rpi.edu
Newsgroups: comp.lang.c++
From: caspers@fwi.uva.nl (John Caspers)
Subject: *protected* inheritance
Summary: What is protected inheritance
Keywords: inheritance; protected
Organization: FWI, University of Amsterdam
Date: Tue, 21 Jul 1992 14:56:50 GMT

Recently, I read something in the C++ Programming Language (2nd ed) about
*protected* inheritance. Does anyone know the use of this kind of
inheritance?

Thanks, John
Newsgroups: comp.lang.c++,comp.std.c++
From: shang@corp.mot.com (David (Lujun) Shang)
Subject: Re: Language extensions for run-time type identification
Reply-To: shang@corp.mot.com
Organization: Motorola, Inc., Software Research and Development, Rolling Meadows, IL. 60008
Date: Thu, 23 Jul 92 13:45:15 GMT

In article <1992Jul21.143131.6902@cadsun.corp.mot.com>, shang@corp.mot.com  
(David (Lujun) Shang) writes:

> The pointer to vtable can not work as a type-ID for a language with multiple  
> inheritance. An object of particular class derived from multiple bases may  
> contain serveral different vtable references. Different base pointers to the  
> same object may use different vtable pointers.

NoIn article <1992Jul22.091752.22521@mole-end> mat@mole-end writes:
> Just a point of fact:
> Not quite true. Those multiple vtable references in a complete object
> all have to point to vtables whose only differences are their `offset
> adjustments.'
> 
Good point! To compare two types then can be done by comparing the segment or  
page number of two vtables. The penalty is only for those C++ implemented in  
16-bit environment. The vtable reference cannot be a 16-bit pointer for small  
programs.

David Shang