HDTenEightyP/NetNews huggingface dataset:
From: se_rossb@rcvie.co.at (Bernhard Rossboth)
Subject: Wanted: Info on Class Libs
Reply-To: se_rossb@rcvie.co.at
Organization: Alcatel ELIN Research
Date: Wed, 18 Nov 1992 13:39:04 GMT

Hallo all,

anyone who has used USL Standard Components, Booch Components or Tools.h++ 
is wellcomed to tell me his/her personal expirences. My main interest is not 
the content of the libs, the prices or licening politics, but more subtle things 
like known bugs, problems, support of the vendor and things like this one normally 
realizes in the middle of a project.

						Barny :-{)


Newsgroups: comp.lang.c++
From: pickerig@eee.bham.ac.uk (Guy Pickering)
Subject: AT&T debugger?
Originator: usenet@rs6000.bham.ac.uk
Date: Tue, 17 Nov 1992 11:13:11 GMT
Organization: The University of Birmingham, England
X-Newsreader: TIN [version 1.1 PL6]

Does AT&T C++ V3.01 comew with a source level debugger?

Guy

--
+--------------------------------+-----------------------------------------+
| Guy Pickering                  | School of Electronic & Electrical Eng,  |
| E-MAIL: G.PICKERING@uk.ac.bham | University of Birmingham,               |
| Tel: (021) 414 4340            | Edgbaston, Birmingham. B15 2TT.         |
+--------------------------------+-----------------------------------------+
| "I have ten pairs of trainers...One for each day of the week" - Sam Fox  |
+--------------------------------+-----------------------------------------+


Newsgroups: comp.lang.c++
From: steve@taumet.com (Steve Clamage)
Subject: Re: ostream or ostream_withassign
Organization: TauMetric Corporation
Date: Fri, 20 Nov 1992 00:27:22 GMT

jjamison@bellahs.com (John Jamison RD AC) writes:

>I'm getting an "Illegal Instruction" crash in a program. The situation
>is a function, void foo_print(ostream& o). The caller is calling
>foo_print(cerr).  In foo_print, the illegal instruction occurs during
>a statement like o << "Some message text\n";  

>With a symbolic debugger (pdb) I look at cerr and o. In the caller,
>the debugger tells me that cerr is an instance of ostream_withassign.
>In foo_print() it tells me that o is of type ostream. They resolve to
>different addresses.

>Has anyone else had similar problems (Sun-SPARC, with CenterLine c++)?
>Just what is the difference between an ostream_withassign and an ostream?

An ostream_withassign is just an ostream.  It is a hack to allow the
initial creation of the standard streams (cin, cout, cerr, clog)
which are just "withassign" version of istream and ostream.  The
"withassign" versions contain no extra data and are derived directly
from the normal stream class, and so should not change address when
pointers are cast to the normal stream base class.  (See <iostream.h>
for the declarations of these classes.)

With the following program:

	#include <iostream.h>

	void foo(ostream &o)
	{
	    cout << "o   :" << &o << endl;
	}

	main()
	{
	    cout << "cerr:" << &cerr << endl;
	    foo(cerr);
	    return 0;
	}

You should find the same address printed twice.  It may be that the
debugger was giving you the address of the formal parameter ("o" in
my example) rather than the address of the object referred to ("cerr").

I suspect that either you are not properly including the iostream
header files where required, or that you have some other programming
error which results in the crash.
-- 

Steve Clamage, TauMetric Corp, steve@taumet.com
Vice Chair, ANSI C++ Committee, X3J16
Newsgroups: comp.lang.c++
From: mccauleyba@vax1.bham.ac.uk (Brian McCauley)
Subject: Re: operator overloading
Date: Tue, 17 Nov 1992 18:41:36 GMT
Organization: University of Birmingham

In article <Bxu3DB.F7n@news.cso.uiuc.edu>, pl2440@meibm31.cen.uiuc.edu (Paul Jay Lucas) writes:
> In <1992Nov16.200145.23491@aifh.ed.ac.uk> iab@cstr.ed.ac.uk writes:
> 
> 
>>I'm looking for some help with operator overloading. I have
>>successfully overloaded operators acting on statically declared  user
>>defined classes but I would like to declare my classes dynamically and
>>still use my overloaded operators. Is this possible, i.e. to use
>>overloaded operators on pointers to a class without dereferencing
>>explicitly.     
> 
> *****>	No; pointers are not first-class objects; operators can only be
> 	overloaded for class types.

Unless of, course, you make them 1st-class :-)

template <class T> Ptr { 
  T* ptr;  
public:
  Ptr(T* p) : ptr(p) {}
  operator T* () {return ptr;}
  T* operator->() {return *this;}
};

Now if you use variables of type Ptr<T> can now be used in place of T* and
you can define operators using Ptr classes. If you don't have templates then
you'll need to define one Ptr class for each class by hand.

> 	You might consider using references whereever you can.
Yes. If you can manage to do it this way it's probably better.
-- 
    \\   ( )    No Bullshit!     |  Email: B.A.McCauley@bham.ac.uk   
 .  _\\__[oo        from         |  Voice: +44 21 471 3789 (home)
.__/  \\ /\@    /~)  /~[   /\/[  |    Fax: +44 21 625 2175 (work)
.  l___\\      /~~) /~~[  /   [  |  Snail: 197 Harborne Lane,
 # ll  l\\    ~~~~ ~   ~ ~    ~  |         Birmingham, B29 6SS, UK
###LL  LL\\   (Brian McCauley)   |   ICBM: 52.5N 1.9W
From: assist@orion.oac.uci.edu (ASSIST Coordination Site)
Subject: New Employee Test
Newsgroups: comp.lang.c++
Date: 16 Nov 92 20:06:10 GMT


Hi everyone,

i am in the process of hiring 2 C++ programmers.  This Wednesday 11/18/92
we are cunducting the final interviews with 4 candidates.


I have a C++ question I would like them to address (sort of a programming test, but not really) but I'm not sure if it's too simple or too complex.

I could also use some suggestions on what might be usefull to ask them.

The question follows:

The following program makes use of a class (TestClass) with a static data member (count) that keeps track of the number of instances of the class that currently exist.  Suprisingly, however, the output of this program is "1 object(s) currently exist."  Why did this happen?  What changes can you make to correct the problem?

#include <iostream.h>

class TestClass {
        int value;
        static int count;
public:
        TestClass(int newValue=0) : value(newValue) {count++;}
        ~TestClass() {count--;}
        int getValue() {return value;}
        friend int getTestClassCount();
};

int getTestClassCount() {return TestClass::count;}

int TestClass::count = 0;

void main() {
        TestClass a;
        TestClass b=3;
        {
              TestClass c=a;
        }
        cout << getTestClassCount() << " object(s) currently exist" << endl;
}



There it is .....  I would guess that many of the people on comp.lang.c++ know the answer.  Hint:  it has to do with the copy constructor.

I could really use some feedback on what you think about asking this type of question to determine whether someone really knows C++ or whether the've just read some books.

Any other suggestions for what to do during these interviews would be greatly appreciated.             

Thanks in advance for any responses before Wednesday.

Eric Taggart
University of California
eric@fs2.assist.uci.edu

P.S. Please feel free to either e-mail or post responses.  I will continue to monitor this area for a while.  Muchos Gracias. :)

    o
 __/\_>
(),> /()

--
Newsgroups: comp.lang.c++
From: sngotk@cc.curtin.edu.au
Subject: WANTED: HC11 simulator in C++
Organization: Curtin University of Technology
Date: Tue, 24 Nov 1992 01:18:40 GMT

I need a simulator for the Motorola M68HC11 chip programmed in C++.

Can some kind soul please send information on books available,
routines or the actual source code to the above address.

Please feel free to send routines or source code in a language
(God forbid) other than C++.

Much obliged.
Newsgroups: comp.lang.c++
From: sbgros@skcla.monsanto.com
Subject: looking at bits
Organization: Searle, Skokie, IL
Date: Wed, 18 Nov 1992 10:53:41 GMT

I'm using borland c++ to perform some communication functions.
I'm only experimenting right now though.  I'm using the bioscom
function to test for different conditions.  The qeustion I have is.
How to I read the bits of a 16-bit integer.  The example in the
book shows that 0x100 is bit 5 (I think that what its refering to),
but anyway how do I figure out what the hex address is for the bits 
0-15?  

  the next part of my problem for the future is.

  the function returns this 16-bit integer what I store in a register,
  for quick access, then I use an if statement to see if something
  is true  if (status & 0x100)  how do these compare to give me a true 
  or false.  I've looked in the book but very vaige (sp) .

any and all help would be super !!

thanks

scott

Newsgroups: comp.lang.c++,comp.std.c++
From: sakkinen@jyu.fi (Markku Sakkinen)
Subject: Re: The fate of my exponentiation operator proposal
Organization: University of Jyvaskyla, Finland
Date: Tue, 17 Nov 1992 10:43:05 GMT

In article <MATT.92Nov12234242@physics16.berkeley.edu> matt@physics.berkeley.edu writes:
>A while ago, as some of you probably remember, I posted a proposal
>(X3J16/92-0127 and WG21/N0204) for adding an exponentiation operator
>to C++.
> ...
>I am sorry to see this proposal rejected because I still believe that,
>of the currently popular languages, C++ is probably the best suited
>for the type of scientific programs that I write.  The absence of an
>exponentiation operator, however, will make it harder for me to
>persuade my colleagues to that point of view."

One more reason for you to evaluate the other language alternatives
in earnest, I suggest.  Perhaps your colleagues have even other grounds
than pure stubbornness to favour some other languages.  (Although
I can imagine that there are people who continue to write "Fortran II"
from decade to decade, and refuse to learn anything else.)

----------------------------------------------------------------------
Markku Sakkinen (sakkinen@jytko.jyu.fi)
       SAKKINEN@FINJYU.bitnet (alternative network address)
Department of Computer Science and Information Systems
University of Jyvaskyla (a's with umlauts)
PL 35
SF-40351 Jyvaskyla (umlauts again)
Finland
----------------------------------------------------------------------
Xref: sparky comp.lang.c++:16359 comp.lang.c:16598
From: andreas@appel012.hydromech.uni-hannover.de (Andreas Dunker)
Newsgroups: comp.lang.c++,comp.lang.c
Subject: Re: Delete a dynamically allocated 2-dim'l array?
Date: 16 Nov 92 14:27:10 GMT
Organization: RRZN
X-Newsreader: Tin 1.1 PL4

xjzhu@math.uwaterloo.ca (Xiaojun Zhu) writes:
: 
: Q: How to delete a dynamically allocated 2-dimensional array?
:  
: More specifically, I have:
: 
:    int row, column;
:    int **array;
: 
[ deleted ]
: 
: Can I simply say:
: 
:    delete array;
: 

You only have "free'd" the pointer to th array of pointers,
but the memory is still allocated.

: Or should I say:
: 
:    for(i=row-1; i>=0; i--)
:       delete array[i];
:    delete array;
: 

This is the right way.

______________________________________________________________________________

Andreas Dunker                                Institut fuer Stroemungsmechanik
andreas@appel012.hydromech.uni-hannover.de          und elektronisches Rechnen
                                                                   im Bauwesen
                                                         Universitaet Hannover
2B  |  ! 2B  (W. Shakespeare)                                     West Germany
______________________________________________________________________________
Newsgroups: comp.lang.c++
From: nikki@trmphrst.demon.co.uk (Nikki Locke)
Subject: Re: On Trees vs. Forests.  was: Should I use a generic objec
Reply-To: nikki@trmphrst.demon.co.uk
Distribution: world
X-Mailer: cppnews $Revision: 1.20 $
Organization: Trumphurst Ltd.
Date: Mon, 23 Nov 1992 13:07:29 +0000

In article <rmartin.722279904@thor> rmartin@thor.Rational.COM (Bob Martin) writes:
> The tree model has the advantage that every object will inherit some
> baseline functionality.  For example, every object may inherit the
> ability to print standard debugging messages, or the ability to know
> the name of its class.  Every object could inherit the ability to
> Print or Dump or Gargle with salt water.
..
> The disadvantages of the forest model are the lack of common paradigms
> for dealing with the objects.  Each object may have a Print or Gargle
> method, but there is no common abstract class which encapsulates that
> ability.  Moreover, since reqularity is not enforced, Print and Gargle
> may have different signatures and behave in different ways.
This is what multiple inheritance is for ! The library should have classes
Printable and Throat, with methods Printable::print, and Throat::Gargle. 
Those classes which need to be printed inherit from Printable, and those 
which have bad breath inherit from Throat.

-- 
Nikki Locke,Trumphurst Ltd.(PC and Unix consultancy) nikki@trmphrst.demon.co.uk
trmphrst.demon.co.uk is NOT affiliated with ANY other sites at demon.co.uk.
Newsgroups: comp.lang.c++
From: rmartin@thor.Rational.COM (Bob Martin)
Subject: Re: Squares and Rectangles (Re: Const Inheritance)
Organization: Rational
Date: Fri, 20 Nov 1992 15:18:04 GMT

This has probably already been said, but I would like to reiterate it.

Objects, in the OO paradigm, have both state and behavior.  Shapes,
such as squares and rectangles, in the geomety paradigm, have only
state.  A Square object, in an OO Program, is not equivalent to a
geometrical square, because it has behaviors as well as state.

A geometrical classification structure would assert that a square is a
rectangle, because it conforms to all the constraints of a rectangle,
and adds a few more.  In a mathematical world, ISA is the inheritance
of contraints.

An OO classification structure could not assert that a Square is a
rectangle, because the Rectangle has behaviors and states that the
Square cannot inherit.  In OO, ISA is the inheritance of state and
behavior.  

Thus, a Square object is not a kind of a Rectangle object.  They
belong in two separate classifications.  However, there may be
conversion functions which convert a Square into a Rectangle.  This is
possible because of the mathematical relationship of the constraints.


=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

This kind of mismatch between mathematical classification structures
and OO classification structures is common in OO analysis.  It does
not represent a flaw in either form of representation, it simply
punctuates that the two forms of modeling are based on different
premises.  Specifically that objects are active entities which must
have behavior as well as state.

There is an awful lot of chatter about "real-world" modeling in OO.
It is often asserted (by me as well as others) that OO is "better"
because we can model our applications in terms of real world objects.
But there are many different kinds of world views, and OO cannot
directly represent all of them.  This should not be viewed as a
weakness or a failure.  There are no modeling systems which can
directly represent all world views (Godel).  OO is very good at
representing the kinds of problems which can be solved with a
computer.  Such applications tend to be easy to decompose into objects
with state and behavior.


--
Robert Martin                        Training courses offered in:
R. C. M. Consulting                       Object Oriented Analysis
2080 Cranbrook Rd.                        Object Oriented Design
Green Oaks, Il 60048 (708) 918-1004       C++
From: ameesh@lsil.com (Ameesh Desai)
Newsgroups: comp.lang.c++
Subject: Re: Need Yacc & Lex retargeted to C++
Date: 16 Nov 92 20:16:58 GMT
Reply-To: ameesh@lsil.com
Organization: LSI Logic Corporation

In article 21091@murdoch.acc.Virginia.EDU, cgh6m@darwin.clas.Virginia.EDU (Craig G. Hocker) writes:
>This seems to be a topic of some interest, so I will mention a 
>C++ Parser Class Kit I came across by accident yesterday while
>downloading another file. Nobody has mentioned it.
>
>anonymous ftp to  export.lcs.mit.edu
>
>    contrib/yacc.shar.Z
>
>
>warning: it's a beta version, but the author does seem to be actively
>soliciting people to modify and send him enhancements.
>
>I can't comment on it, since I haven't tried to do anything with it
>yet.
>
>cgh6m@darwin.clas.virginia.edu
>Craig G. Hocker
>NSF-Center for Biological Timing
>University of Virginia, Charlottesville, VA 22901
>---- yep, that means I'm a scientist and not a computer jock! ----


The implementation seems to encapsulate only the global yacc variables within a 
C++ class. In effect providing a C++ "wrapper" to yacc calls and vars.

The problem with yacc is not its variables. Its making yacc understand C++ 
class definations. You should ideally be able to write stuff like...

%{

class A {   // some C++ class
...
public:
	A();		// see note below ... this would cause problems with yacc
};

%}

%union
{
int ival;
float fval;
char *sval
A aclass; 		// make this work !
}

%type <aclass> rule_that_returns_a_class

....
%%

The fact that a class contains a ctor/dtor should not prevent it
from being returned. The current yacc implementation depends on union for
declaring the return type, and C++ will not allow a class with a ctor/dtor
to be part of the union !


Ameesh


---
______________________________     o__            
| _   /|     Ameesh Desai     \    ,>/_                              
| \`O.o'     LSI Logic Corp.   \__(_)`(_)_              email: ameesh@lsil.com
| =(_|_)=    MS E192, 1501 McCarthy Blvd. \             fax  : (408) 433-6802
|____U_______Milpitas, CA 95035____________\____________voice: (408) 433-4097 
Newsgroups: comp.lang.c++
From: chiu@snoopy.stdavids.picker.com (Arnold Chiu)
Subject: Call interfaces
Organization: Picker International, St. Davids
Distribution: comp.lang.c, comp.lang.c++
Date: Mon, 23 Nov 1992 14:58:18 GMT


My last posting never returned, so I'm trying again.
Sorry for any duplicates.

--- Included Message ---

Newsgroups: comp.lang.c++
Subject: Call interfaces
Distribution: comp.lang.c, comp.lang.c++

Someone told me that you can call C++ routines from within
a C program, and vice versa.  How is this done?

Any ideas will be much appreciated.

Please send mail to me directly at chiu@stdavids.picker.com

Thanks.		Arnold.
Newsgroups: comp.lang.c++
From: frank@Cookie.secapl.com (Frank Adams)
Subject: Re: virtual functions need virtual destructors ?
Date: Mon, 23 Nov 1992 17:23:04 GMT
Organization: Security APL, Inc.

In article <kilitzir.722528914@news.forth.gr> kilitzir@antigone.csi.forth.gr (Xristos Kilitzirakis) writes:
>
>Why do virtual functions need virtual destructors ?

Two reasons.

1) There is a default assumption that when you have virtual functions, you
will be making virtual calls: that is, calls where you don't know the actual
type of the object whose member function is being called, because you have
only a pointer or reference to the object, and might actually be dealing
with a subclass.  Note that there is little point in having a pointer to
class with no virtual functions that might actually point to a subclass --
there is no [type-safe] way of using the actual class.  Since you are likely
to have such a reference, it is likely that you will want to delete by means
of it -- and this will only work if you have a virtual destructor.
(Furthermore, the bugs that result from failing to make the destructor
virtual are pretty subtle.)

2) The cost of having a virtual destructor in a class with virtual functions
is very small.  The run-time cost of calling a virtual function is not
large, and the space cost is simply one additional slot in the virtual
function table for each class.  By contrast, adding a virtual destructor to
a class which otherwise had no virtual functions requires adding a virtual
function table pointer to each *instance* of the class -- which can be quite
costly if the class doesn't use much data and there are lots of them.

So a class with virtual functions can cheaply be given a virtual destructor,
which costs little and can easily prevent difficult bugs.  Giving a class
with no virtual functions a virtual destructor is more expensive, and
unlikely to do much good.
From: kilitzir@antigone.csi.forth.gr (Xristos Kilitzirakis)
Newsgroups: comp.lang.c++
Subject: g++ manual WHERE?
Date: 20 Nov 1992 10:07:06 +0200
Organization: Institute of Computer Science, FORTH Hellas
NNTP-Posting-Host: antigone.csi.forth.gr
Keywords: g++

Can anyopne tell me where I can ftp the latest g++ manual ?
An please tell me , what the hell is emacs  Arghhh.


XXristos K.
From: wendy@cs.uq.oz.au (Wendy Johnston)
Newsgroups: comp.lang.c++
Subject: c++ syntax
Keywords: syntax
Date: 23 Nov 92 22:47:03 GMT
Reply-To: wendy@cs.uq.oz.au

I would like a bnf syntax for c++ (including template features).
My email address is wendy@cs.uq.oz.au .
Newsgroups: comp.lang.c++
From: benderly@cs.columbia.edu (Dan Benderly)
Subject: Complex Numbers
Summary: Looking for ways to use complex numbers in C++
Organization: Columbia University Department of Computer Science
Distribution: usa
Date: Sat, 21 Nov 1992 00:17:11 GMT

Hi,
	I am doing a circuit analysis project in C++ that requires the use
of complex numbers.  Does C++ have any special functions to handle them?
Are there any special include files that do complex numbers?  Thanks in
advance for any help you can give me.

Gil Benderly
(benderly@ground.cs.columbia.edu) 


Newsgroups: comp.lang.c++
From: mccauleyba@vax1.bham.ac.uk (Brian McCauley)
Subject: Re: Operator -> cannot return non-class types?
Date: Tue, 17 Nov 1992 13:14:37 GMT
Organization: University of Birmingham

In article <a008546a@p3.f6.n249.z2.fidonet.org>, Gilles_Kohl@spam.fido.de (Gilles Kohl) writes:
>  > What is the rationale behind this restriction? I couldn't find anything
                 ^^^^^^^^^
>  > in C++PL 2nd ed. that mentions this restriction, although I didn't look too
>  > hard.
> Daniel,
> 
> I think the following on page 594 of C++PL2 applies:
> 
> r.13.4.6 Class Member Access
> 
> (...) An expression x->m is interpreted as (x.operator->())->m for a class 
> object x. It follows that operator-> must return either a pointer to a class or 
> an object of or a reference to a class for which operator->() is defined. 
> operator->() must be a nonstatic member function.
I think you've lost the thread of this thread.
(I gave roughly the above reply last week :-) )
The _real_ question is not _does_ the restriction exist but _why_ does
it exist? One clealy couldn't _use_ an operator->() returning anything else.
BUT there can be good reason for a template class to have an operator->()
that would only be usable for some values of the template parameter.

template <class T> PtrClass { T* operator->();};

I now fully support the original poster's assertion that this restriction
should be lifted now that the language has templates.
-- 
    \\   ( )    No Bullshit!     |  Email: B.A.McCauley@bham.ac.uk   
 .  _\\__[oo        from         |  Voice: +44 21 471 3789 (home)
.__/  \\ /\@    /~)  /~[   /\/[  |    Fax: +44 21 625 2175 (work)
.  l___\\      /~~) /~~[  /   [  |  Snail: 197 Harborne Lane,
 # ll  l\\    ~~~~ ~   ~ ~    ~  |         Birmingham, B29 6SS, UK
###LL  LL\\   (Brian McCauley)   |   ICBM: 52.5N 1.9W
From: mat@mole-end.matawan.nj.us
Subject: Re: Proposal - enhancement for switch statement.
Summary: !  ~break    !!!!
Organization: :
Date: Tue, 17 Nov 1992 06:38:45 GMT

In article <1992Nov16.004558.9855@muddcs.claremont.edu>, dfoster@jarthur.claremont.edu (Derek R. Foster) writes:
> In article <MCGRANT.92Nov15132747@rascals.stanford.edu> mcgrant@rascals.stanford.edu (Michael C. Grant) writes:
> >In article <1992Nov15.190830.11622@cssc-syd.tansu.com.au>
> >pete@cssc-syd.tansu.com.au (Peter Alexander Merel) writes:

>   1) ...   Make a 'break' the default, rather than fallthrough
>      being the default. Add a 'fallthrough' keyword (or extend the
>      meaning of the 'continue' keyword perhaps?) ...

Please don't suggest  ~break .  I can imagine the (ahem) consternation
in x3j16/WG21 at another  ~-punned keyword.
-- 
 (This man's opinions are his own.)
 From mole-end				Mark Terribile

 mat@mole-end.matawan.nj.us, Somewhere in Matawan, NJ