HDTenEightyP/NetNews huggingface dataset:
From: jimad@microsoft.com (Jim ADCOCK)
Subject: Re: Followup to Dynamic Allocation
Date: 10 Apr 92 19:15:06 GMT
Organization: Microsoft Corp.

In article <850347s.702429765@aucs> 850347s@aucs.acadiau.ca (Hume Smith) writes:
>aren't new and delete very different semantically from malloc and free?
>because of the implicit constructor and destructor calls?

Sorry for the confusion, which arises from when people like me say simply
"new" and "delete" without clarifying whether we are referring to the
"new keyword" and "delete keyword" or the "new operator" and the "delete
operator."

I was referring to the later.  The former do indeed involve construction
and destruction.  The later, however, have functionality at least superficially
similar to malloc/free, are frequently inplemented using malloc/free, and
are at least superficially intermixable with malloc/free in that case.
Not to imply using malloc/free is how these things *ought* to be implemented....
From: herman@cs.kuleuven.ac.be (Herman Moons)
Newsgroups: comp.lang.c++
Subject: class specific storage management
Date: 7 Apr 92 08:05:18 GMT
Organization: Dept. Computerwetenschappen K.U.Leuven

I'm currently investigating different techniques for doing class-specific
storage management.  Some possibilities are:

   o  Pre-allocate an array of storage buffers, and allocate/release from/to
      this pool.
      advantage: fixed cost for new/delete (interesting for applications with
                 real-time constraints)
      disadvantage: what if the pool is exhausted ?

   o  Keep a free list of storage blocks. New allocates from the free list, or
      uses ::new if free list is empty. Delete deallocates to free list.
      advantage: most of the time, storage will be available on the free list
                 (fast)
      disadvantage: how to decide when to release storage on the free list that
                    is no longer needed ?

No doubt there are lots of other possible scenario's. I'm trying to make a 
survey of these. If you have used class-specific storage management yourself,
please let me know the approach you followed (with advantages/disadvantages
if possible).
Please reply by E-mail. I'll post the survey to the net.

herman
-----------------------------------------------------------------------------
Herman Moons                                   Katholieke Universiteit Leuven
                                               Dept. of Computer Science
Tf : +32 (16) 20.10.15 ext 3642                Celestijnenlaan 200A
Fax: +32 (16) 20.53.08                         B-3001 Heverlee-Leuven
                                               Belgium
e-mail: herman@cs.kuleuven.ac.be
-----------------------------------------------------------------------------
From: rmartin@willing.Rational.COM (Bob Martin)
Newsgroups: comp.lang.c++
Subject: Re: Call by reference using * and &
Date: 16 Apr 92 19:27:10 GMT
Article-I.D.: willing.rmartin.703452430

jbn@lulea.trab.se (Johan Bengtsson) writes:

>rmartin@willing.Rational.COM (Bob Martin) writes:
>: lam@saifr00.cfsat.honeywell.com (Josh Lam) writes:
>: Secondly, the forms:
>: 	
>: 	void f(TYPE*);
>: 	void f(TYPE&);
>: 
>: [...] The reference form
>: *guarantees* that a real object is being refered to.

>	Too strong wording.  The reference _should_ guarantee
>	that there is a real object.  In practise it just might be
>	(a reference to) a dereferenced null pointer:

Quite right.  I used the wrong emphasis.  Should have used :-?


>	In practise, an assertion may be appropriate:

>	void f(const TYPE& t)
>	{
>		assert( &t != 0 );
>		// ...
>	}

But, is this guaranteed to be portable?  The constant '0' has a very
special relationship with pointer types.  i.e. The constant '0'
represents a pointer to nothing.  It is not guarnateed that the actual
bit patter of a pointer value assigned to '0' will be all zeroes.

This relationship does not extend to references.  Thus, the following
code may fail:

       int* p = NULL;
       int& r = *i;
       assert(&r == 0);

The '*' operator in the expression '*i' may not be able to properly
handle NULL pointers.  Certainly the ARM gives no clue about the
semantics of such a construct.  

The address_of operator '&' may not be able to properly interpret the
bit pattern represented by a NULL pointer, and reconvert it to 0.
Again, the ARM gives us little help in interpreting this.

So, the realm of NULL references sounds very dangerous to me.  I suggest
that users everywhere should *guarantee* that references are never NULL.
--
+---Robert C. Martin---+-RRR---CCC-M-----M-| R.C.M. Consulting         |
| rmartin@rational.com |-R--R-C----M-M-M-M-| C++/C/Unix Engineering    |
|     (Uncle Bob.)     |-RRR--C----M--M--M-| OOA/OOD/OOP Training      |
+----------------------+-R--R--CCC-M-----M-| Product Design & Devel.   |
Newsgroups: comp.lang.c++
From: fritz@netcom.com (Fritz Robbins)
Subject: looking for info on "cback"
Date: Thu, 09 Apr 92 04:08:43 GMT
Organization: Netcom - Online Communication Services  (408 241-9760 guest) 
Summary: looking for info on "cback"
Keywords: cback

Like the subject says, I'm looking for a program
that someone mentioned which will clean up
cfront-generated code.  My application is running
C++ code in an environment where only a C source
debugger is available.  Specifically, I'm targeting
code for an IDT 3051 controller (Mips R3000 instruction
set) and looking at using Mips' dbx to do remote
debugging since they have the only debugger (besides
IDT's) which is integrated with the 3051's monitor.
(Apparently, neither the Mips nor IDT debugger have C++ 
source support).

Any info or leads on cback or any other suggestions
pertinent to my problem are appreciated.  

- Fritz
-- 
Fritz Robbins                        fritz@netcom.com
Luna Software Consulting
*****************************************************************
<Profound quotation here>            <Clever disclaimer here>
*****************************************************************
Newsgroups: comp.lang.c++
From: philip@CS.Stanford.EDU (Philip Machanick)
Subject: Re: Call by reference using * and &
Reply-To: philip@pescadero.stanford.edu
Organization: Computer Science Department, Stanford University
Date: Fri, 17 Apr 1992 16:04:18 GMT

In article <1992Apr17.143826.6461@apollo.hp.com>, vinoski@apollo.hp.com (Stephen Vinoski) writes:
[...]
|> 
|> Here, x could potentially be changed by function baz, but in this case that
|> fact is certainly not clear from looking at the invocation of baz.
|> 
|> The only reliable way to determine whether or not a function could potentially
|> modify its arguments is to look at its declaration.

This is true, but unfortunately if the argument is an array,
the C/C++ view of an array as a pointer doesn't help you with
either notation. This seems to me to be a more serious weakness
though it would be interesting to have some empirical measure of how
many bugs / how much lost time is attributable to these
language features.
-- 
Philip Machanick
philip@pescadero.stanford.edu
From: ersys!bking@agchem.redwater.iol.ca (Barry King)
Newsgroups: comp.lang.c++
Subject: Re: C++ name mangling and dynamic loading
Date: Wed, 15 Apr 92 18:43:35 MDT
Organization: Edmonton Remote Systems, Edmonton, AB, Canada

jmb@fid.morgan.com (Jeff Birnbaum) writes:

> The question: does anyone know how to dynamically load C++ code or more 
> precisely I need to know how to do name mangling. The following example 
> should help explain better.
> 
> What I have: class, function name, args, return type - i.e. prototype
> 
> What I want: the mangled name that is stored in the object file.
> 
> I have an interpreter running that needs the address of the routine, but 
> I can only provide it the prototype - the mangled name allows it to get 
> the address.
> 
> In 'C' this is trivial - each function name just has a leading underscore.
> 
> If I had a mangler routine then I believe that the dynamic load would be 
> just as trivial, but I cannot such a utility.
> 
> I'm running Sun C++ 2.1 on a SPARCstation.
> 
There is no (current) specification for name mangling that I am aware of. 
 Name mangling is implementation specific.  What you can do is wrap a 
plain C wrapper around your exported C++ method and call the C function 
as an external routine.
 
It would be nice if name magling was made a rigid part of the language 
specification so that sharing pre-compiled libraries amongst various C++ 
compilers would be possible.  This is a naive opinion, perhaps, as I 
don't follow the happenings of the C++ Deities...
 
Anyway, the above method works.  It is more than a little cumbersome if 
you have a lot of methods to export, however.  If you want to get into 
name mangling, your compiler maker should be able to give you the 
algorithm.  JPI, f'rinstance, publishes it as part of the documentation 
for their C++ product.

Barry King              bking@ersys.edmonton.ab.ca
Edmonton Remote Systems:  Celebrating 10 years of service to Northern Alberta
Newsgroups: comp.lang.c++
From: senften@taurus (Scott D. Senften)
Subject: message passing between objects
Organization: Shell Oil
Distribution: usa
Date: Tue, 7 Apr 92 14:48:38 GMT


Hello all,

I'm new to this group and c++ as a whole so please forgive me if this is an
FAQ.

I need to know the best way to send a message between two objects that don't
"know" about each other.  Specifically, I have a list of 3D data objects that
can be edited and rendered.  When a data object is edited, it is possible that
all the other objects in the scene will need to be rerendered (i.e. the 
global extents of the scene have changed).  What I want is to have a member
function of my list object to be registered with a "changed" callback list on
my data object so that when an object is edited it can march down its lists
of functions to notify other interested objects.  What I don't want is my
data object to have to know anything about the list object.

Is there a good way to do this, or do I need a third "higher level" object
that knows about both the list and the objects?

Thanks in advance,


-- 
Scott Senften		senften@shell.com
..!{sun,psuvax1,bcm,rice,decwrl,cs.utexas.edu}!shell!senften
Shell Development Company, Bellaire Research Center
3737 Bellaire Blvd., Houston, TX 77025		(Voice: 713 245-7167)
From: sab@reef.cis.ufl.edu (Shawn Berg)
Newsgroups: comp.lang.c++
Subject: Set class
Summary: Good book on a Set class wanted
Keywords: book set
Date: 14 Apr 92 18:36:29 GMT
Organization: Univ. of Florida CIS Dept.

I was wondering if anyone could recommand a good book that has an example
of an implementation of a SET class?

Thanks,
Shawn Berg

E-mail: sab@reef.cis.ufl.edu
From: l.d..bricker@ehbbs.hou.tx.us (L.D. Bricker) 
Newsgroups: comp.lang.c++
Subject: BORLAND C++ 3.0 FOR SALE
Date: 14 Apr 92 17:09:00 GMT
Distribution: world
Organization: Ed Hopper's BBS - Houston, TX - 713-997-7575
Reply-To: l.d..bricker@ehbbs.hou.tx.us (L.D. Bricker) 

Just saw your message this afternoon.  Have you sold the package yet?
Does it include the applications frameworks?  Are you at Kansas State?
Might be interested if you still have it.  Thanks.
From: bright@nazgul.UUCP (Walter Bright)
Newsgroups: comp.lang.c++
Subject: Re: NAN and INF numbers in C, C++
Date: 8 Apr 92 16:27:32 GMT
Reply-To: bright@nazgul.UUCP (Walter Bright)
Distribution: usa
Organization: Zortech, Seattle

In article <17745@oasys.dt.navy.mil> vorwald@oasys.dt.navy.mil (John Vorwald) writes:
/How do you initilize a varible to NAN (Not a Number) or INF (infinity) in
/C or C++?  (I'm using Borland 3.0, but it shouldn't matter).

With Zortech C/C++:

	#include <fltpnt.h>

	double d = NAN;
	double d2 = INFINITY;

Note that you can use NAN and INFINITY to statically initialize doubles.
Newsgroups: comp.lang.c++,comp.std.c++
From: lam@saifr00.cfsat.honeywell.com (Josh Lam)
Subject: Call by reference using * and &
Organization: Honeywell Air Transport Systems Division
Date: Mon, 13 Apr 92 21:43:11 GMT

In C++, call by reference can be accomplished using pointers (like in C) or
by reference (&).  Question:  What are some advantages of using references
over pointers (or vice versa)

ie the following functions accomplish pretty much the same thing:

void func1(int & i)  // using the reference method
{
  ...
}

and 

void func2(int * i)  // using pointer method
{
  ...
}


The couple of advantages (at least from my limited experiences with C++) of
using the reference method over the pointer method are:

1)  It provides a cleaner interface into the function, makes it a little 
    easier to read and to use

2)  The programmer does not have to worry about the address of the pointer,
    makes it a little easier to program

Thus,  

void func1(int & i)  // reference method
{
   ...

   i = 100;

   ...
}

is 'preferred' over

void func2(int * i)   // pointer method
{
  ...

  *i = 100;

  ...
}


What are some other advantages? Is one really often (if not
always) preferred over the other?

I appreciate any comments.  If this has already been discussed
in a separate subject, I apologise for repetition.

Thanks!

Josh Lam
Honeywell Inc
@cum-vax.honeywell.com:lam@saifr00.cfsat.honeywell.com

-- 
Josh Lam
Honeywell Inc
@cum-vax.honeywell.com:lam@saifr00.cfsat.honeywell.com
From: mayor@bayes.ece.cmu.edu (Gilberto S. Mayor)
Newsgroups: comp.lang.c++
Subject: Matrix Library Needed (PC version)
Date: 7 Apr 92 18:14:19 GMT
Organization: Electrical and Computer Engineering, Carnegie Mellon

Hi,

Does anyone know any C++ library that handles matrix operations (for IBM PC)?
I need a C++ library, not a C library. I mean, that I need a library
that declares a new class "matrix".
Thanks in advance,

Gilberto

Please send anwers to both adresses:

cruz@brufmg.BITNET
mayor@bayes.ece.cmu.edu
From: huw@oxygen.siesoft.co.uk (Huw Roberts)
Newsgroups: comp.lang.c++
Subject: Re: how to implement a[i] =
Date: 7 Apr 92 16:41:54 GMT
Organization: Siemens Nixdorf Systems Development Group, UK.

mwizard@rigel.cs.pdx.edu (Craig R. Nelson) writes:
>
>inline ObjectDef& operator +( ObjectDef& one, ObjectDef& two )
>{
>  ...Stuff to create a new object...
>  ...Then perform the addition...
>  return theResultObject.
>}
       
Just as a matter of style (no criticism of Craig's post at all), I believe
it is normal to make an operator of this sort be:

             v             v                     v
    ObjectDef operator +(const ObjectDef& one, const ObjectDef& two)

if you can because 
(i) Addition operators normally don't affect their arguments and making this
change to the types of the arguments makes it possible to use const objects
as parameters (note that this doesn't affect the use of non const objects).
(ii) You will normally be unable to return a reference from an addition
function because the object you create as a result of the addition will be
an automatic.

Huw
--
If you want to flame, mail me directly and I'll summarise the best.
Huw Roberts (huw@siesoft.co.uk) Siemens Nixdorf Information Systems Ltd.
Newsgroups: comp.lang.c++
From: gary@clarinet.mitre.org (Gary Bisaga)
Subject: Re: Borland's Customer Service
Reply-To: gbisaga@mitre.org
Organization: The Mitre Corporation, McLean Virginia
Date: Tue, 14 Apr 1992 17:40:56 GMT

In article <1992Apr9.165751.3756@gw.wmich.edu>, 91erol@gw.wmich.edu writes:
|>     Even though I ordered Borland C++ & Application Frameworks in the beginning of
|> March directly from Borland Corporation, still I have to wait three weeks more.
|> That is what I heard from the customer representative over the phone. You have
|> to wait for 30 minutes on the phone to talk to a customer representative.
|> 
|>    I am wondering if I am dealing with a company which has the worst customer
|> service in the USA. Borland is supposed to be one of the best, unfortunately
|> it does not seem so. 
|> 
|>    I think Borland should improve its customer service. I have found better
|> customer service when I first contacted with Microsoft. 
Hmmm, I had no such problems.  I got my 3.0 update in about a week and a half after
I MAILED IN the paperwork.

Granted, I have had to sit on the phone line for awhile when calling tech support,
but no worse than with Microsoft or any other major vendor.  I have never had
problems with Borland's customer service.

-- 
Gary Bisaga (gbisaga@mitre.org)
Xref: sparky comp.lang.c++:6802 comp.std.c++:397
From: mac@coos.dartmouth.edu (Alex Colvin)
Newsgroups: comp.lang.c++,comp.std.c++
Subject: Re: Call by reference using * and &
Date: 15 Apr 92 12:27:37 GMT
Organization: Dartmouth College, Hanover, NH

lam@saifr00.cfsat.honeywell.com (Josh Lam) writes:

>In C++, call by reference can be accomplished using pointers (like in C) or
>by reference (&).  Question:  What are some advantages of using references
>over pointers (or vice versa)

>Thus,  
>void func1(int & i)  // reference method
>is 'preferred' over
>void func2(int * i)   // pointer method

One advantage of the older pointer method is that the caller makes it
explicit that the integer (*i) is subject to change.
References are handy for those cases where addresses are passed just
in order to avoid copying data
--
Alex Colvin
New England Digital
mac@cs.virginia.edu
From: dmitry@conan.UUCP (Dmitry Gringauz)
Newsgroups: comp.lang.c++
Subject: Microsoft c/c++ 7.0
Keywords: Need more info
Date: 14 Apr 92 17:15:20 GMT

I need more information on Microsoft c/c++ 7.0.  What version of c++ does
it conform to (2.0, 2.1?).  Can it produce executables for dos,  and 
does it have a built-in dos extender?   The ads say that "Qualitas 386max"
is included.  What is that product?  What kind of debugging facilities
does it have under dos and under windows?  Basically, I need a detailed
info on the  package.  If  someone would be kind enough to mail me
all  that information, I would appreciate it.

Replies can be sent either to the address in the header or to
dmitry@netcom.com.

Dmitry.

PS.  I've seen the mention of another company (Zortech, Watcom??) offering
a similar "upgrade" package as Microsoft.  What is that company, and what
are the terms of an upgrade.  I am obviously shopping for a good c++
compiler w/windows and dos extender support.
-- 
Dmitry Gringauz
talarian!dmitry@uunet.uu.net  <- work
dmitry@netcom.com             <- personal account (preferred)
From: NHEAD@ESOC.BITNET
Newsgroups: comp.lang.c++
Subject: Re: overloading [] for bitvectors?
Date: 14 Apr 92 07:13:03 GMT
Organisation: European Space Operation Centre (E.S.O.C)

In this case I would also contemplate changing the view of the bitvector
slightly so that you let your users say:

     bitSet := 17;
     if (bitSet & 13) do_something();

This seems closer to the usual style of bit manipulation to me and would
probably be easier for the users to catch on to (IMHO).

Although (as I said in a previous posting) I think the Coplien book is an
excellent source I would try to use the alternate route this time !!

Even closer (but p'haps not needed) would be:

     bitSet := BitSet(17);
     if (bitSet & BitSet(13)) do_something();

This would avoid people misunderstanding '17' as 0x11 and expecting 2 bits to
be set. It would also allow things like:

     bitSet := BitSet(13, 354, 25); // set multiple bits

Just to keep the discussion going !!

Nigel.
Newsgroups: comp.lang.c++
From: schrod@iti.informatik.th-darmstadt.de (Joachim Schrod)
Subject: Re: Gunnar Teege's Emacs C++ class browser
Date: Fri, 10 Apr 1992 09:40:43 GMT
Organization: TU Darmstadt

In article <1992Apr10.044920.3976@philips.oz.au>, brianw@philips.oz.au (Brian Wallis) writes:
> 
> I read somewhere that it should be ftp'able from ftp.informatik.tumuenchen.de
> in the file /pub/GNU/emacs/contrib/c++browser91.tar.Z.
> 
> Unfortunatly I can't even find the machine!

Most probably this machine is named ftp.informatik.tu-muenchen.de.
						     ^

(Note the hyphen.) I don't know if it's there, but in every case it's
on ftp.th-darmstadt.de in pub/languages/C++.
   Sorry, still Europe, not Australia -- but it might help...

--
Joachim

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Joachim Schrod			Email: schrod@iti.informatik.th-darmstadt.de
Computer Science Department
Technical University of Darmstadt, Germany
Xref: sparky comp.lang.c++:6580 comp.std.c++:375
From: nicted@toz.buffalo.ny.us (Nicole Tedesco)
Newsgroups: comp.lang.c++,comp.std.c++
Subject: Re: string.concat
Date: 8 Apr 92 02:41:12 GMT
Organization: The Tower of Zot - (716)838-0220

hmiller@osiris (Harry Miller) writes:

> IMHO, solving linear eqautions needs a distinct function call since it is
> a very special matrix operation.  C++ operators should be defined for basic
> operations, the more complex operations should use function calls.
> 
> I'm new to C++, so forgive me if my opinion does not conform to the
> average though.  But I'm not much of a conformist anyway.
> 
> 
> Harry E. Miller ----------------- just a jerk lurking on the net
> hmiller@osiris.cso.uiuc.edu ----- where to send the hate mail

Don't worry.  Conformist or not, I agree with you.

- Nicole

---------------------------------------------------------------------
nicted@toz.buffalo.ny.us (Nicole Tedesco)
-- Change this!
From: stan@sabaac.mayo.edu (Andrew Staniszewski)
Newsgroups: comp.lang.c++
Subject: a question of language
Date: 16 Apr 92 20:52:24 GMT
Article-I.D.: bmw.1992Apr16.205224.23780
Organization: Mayo Foundation, Rochester MN. Campus



these are some personal opinions on some needed fixes/added features for c++


	1) single argument constructors used for type conversion should 
	have a keyword associated with them.  This would prevent single argument
	constructors not meant for use in type conversion from being misused
	and causeing hard to track bugs.

	2) A default exception handler should be defineable
From: dmh@goanna.cs.rmit.oz.au (Darren Hosking)
Newsgroups: comp.lang.c++
Subject: tree iterator, how?
Date: 14 Apr 92 06:41:35 GMT
Organization: Comp Sci, RMIT, Melbourne, Australia

I've got a simple binary tree class that I'd like to iterate through with
an iterator class. Each node of the tree maintains data and a left and right
node pointer. How can I write an iterator class for the tree class?

Without a class I can simply use recursion to traverse the tree but I cannot
put recursion into a class (can I?).

The only method I can think of is maintaining a stack of parent nodes, but
I'd like something more elegant.

	Thanks in advance, dmh

Darren Hosking			ACSnet: dmh@goanna.cs.rmit.oz	 
Department Of Computer Science	ARPA:   dmh%goanna.cs.rmit.oz.au@uunet.uu.net
RMIT				CSNET:  dmh%goanna.cs.rmit.oz.au@australia
GPO Box 2476V			UUCP:   ...!uunet!goanna.cs.rmit.oz.au!dmh
Melbourne Vic., Australia 3001	PH: +61 3 660 3299 FAX: +61 3 662 1617
Newsgroups: comp.lang.c++,comp.windows.x,comp.windows.interviews,comp.object,comp.sys.sun.misc,comp.sys.next.misc