HDTenEightyP/NetNews huggingface dataset:
From: kirkwood@qucis.queensu.ca (Scott Kirkwood)
Newsgroups: comp.lang.c++
Subject: Re: Survey: File Extension
Date: 13 Dec 92 23:09:30 GMT
Organization: Computing & Information Science, Queen's University at Kingston

I use DOS with GCC and you *can* use .C to mean C++.  When you call
the program gcc on the command line, it has no problem differentiating
between .C and .c

This never occured to me until recently.  Although my make files have
those silly C=.C, O=.O, H=.H definitions you can fairly safely keep
your files with the .C files and have the Makefile tell which ones
are C files and which are C++.  

For Borland C++ you can just tell it that all extensions are C++
extension instead of just .CPP.  

The only problem I see is that when you do a DIR you have no idea
without list the file, whether it's C++ or C.  

BTW: these are the extensions I've come across: .C, .c, .cxx,
.cp (Macintosh), .cpp, .cc, .c++, .C++, .h, .H, and .hxx (off the top
of my head).
From: cbusch@ub.d.umn.edu (Chris)
Newsgroups: comp.lang.c++
Subject: UMAX C++ compiler
Date: 15 Dec 92 20:44:39 GMT
Organization: University of Minnesota, Duluth
NNTP-Posting-Host: ub.d.umn.edu

Here at UMD, we use a computer made by Encore Computer Corp. I was
wondering if there was a C++ compiler for it.  It is an Encore Multimax
running UMAX Unix 4.3 version.
Thanx
--
Chris Busch   CBUSCH@ub.d.umn.edu
"C++ is the language of choice."
"The use of COBOL cripples the mind; its teaching should, therefore,
    be reguarded as a criminal offense." - E. W. Dijkista 
"High-level languages should remove burden from the programmer, not
 put burden on the programmer!"
"Don't ask 'why would you do that?' instead ask 'why wouldn't you do that?'"
Newsgroups: comp.lang.c++
From: kirkwood@qucis.queensu.ca (Scott Kirkwood)
Subject: C++ classes submitted to comp.sources.misc.
Organization: Computing & Information Science, Queen's University at Kingston
Date: Sun, 13 Dec 1992 23:15:15 GMT

Since we don't have a comp.source.c++ group, I thought you would like
to know that I submitted three classes to comp.sources.misc:
    IFormat   fast integer number formatter,
    FFormat   floating point number formatter,
    TFormat   template version of FFormat. (included with fformat)

IFormat was designed to be fast and was originally designed to be used
in a program that lists directories with their file sizes.  FFormat is
far from fast, but is more powerful and extendible.  All of these
programs will format the number so that it fits a certain specified
width.  If the number doesn't fit, the program will attempt to use SI
postfix notation to make it fit.

For example,
  IFormat
    12345678  -> 12,345,678    (/any/ width)
    12345678  -> 12,345K       (width set to 7)
  FFormat
    1234.56789012 -> 1,234.5678 9012 
    1234.56789012 -> 1,234.6   (width set to 7)
    1234.56789012 -> 1K        (width set to 2)
  TFormat<Integer>  
     // using g++'s arbitrary size Integer class 
    123456789012345678901 -> 123,456,789,012,345,678,901

These are not programs, but classes and are not useful by themselves.
One day I hope that there will be many (free) classes that can be
re-used by everyone.

I'd appreciate any comments you have.

-------------------- kirkwood@qucis.queensu.ca ----------------------
      299,792,458 m/s it's not just a good idea, it's the law!



-- 
-------------------- kirkwood@qucis.queensu.ca ----------------------
      299,792,458 m/s it's not just a good idea, it's the law!
From: mharriso@digi.lonestar.org (Mark Harrison)
Newsgroups: comp.lang.c++
Subject: Re: Need help implementic data structures of generic objects
Date: 17 Dec 92 15:02:12 GMT
Organization: DSC Communications Corp, Plano, TX

In article <1992Dec13.002551.778@informix.com> cshaver@informix.com
(Craig Shaver) writes:

>This group seems to be biased against inheritance techniques in all cases.

"Remember that much programming can be simply and clearly done using
only primitive types, data structures, plain functions, and a few
classes from a standard library.  The whole apparatus involved in
defining new types should not be used except when there is a real
need."

	B. Stroustrup, The C++ Programming Language, p.8.

>IMHO, if you do not use inheritance, you are not doing OOP.  If you do
>not care, then you are just using C++ as a variation on C with no real
>benefit.

For another opinion on this, read George Bosworth's "Objects, not
classes, are the issue" in the Nov-Dec 1992 "Object Magazine".  He is
cofounder and vice president of Digitalk, so it's probably fair
to say he's not a C++ weenie.
-- 
Mark Harrison, mharriso@dsccc.com
Newsgroups: comp.lang.c++
From: rmartin@thor.Rational.COM (Bob Martin)
Subject: Re: IS C++ a language for the "average programmer"
Organization: Rational
Date: Tue, 15 Dec 1992 14:58:29 GMT

gopi@enuxha.eas.asu.edu (Bulusu Gopi Kumar) writes:


>I have been following a lot of articles on this group for sometime now.
>There seems to be a lot of confusion on a large number of topics in c++
>among the programmers! Is this because of the fact that c++ is a relatively
>new language ? Is it because c++ is becoming more and more complex by the
>addition of features like "TEMPLATES". Infact even after 2 years of reading
>and reading (though without much of project experience) I often get confused
>with some combinations of c++ features.Is it that "complex" projects can be
>handled by only complex languages ? Any takers for this question ? 

In the book "Structured Programming" by Dijkstra, Dahl and Hoare,
there is an interesting passage.  It is in the chapter which describes
object oriented programming.  It states:

   "The reason for accepting this extra complexity is that it permits
   a wider range of concepts to be conveniently expressed"

Yes, C++ is a complex language.  Moreover, OO is a complex paradigm.
The reason we need this extra complexity is that it allows us more
conveniently exptress a wider range of applications.  In short, by
paying the price of learning a more complex language, we gain the
benefit of being able handle more complex problems.

This is not a new idea.  Calculus is more complex than algebra.  Yet,
once learned, it alows a whole new ream of concepts to be conveniently
expressed.  If we did not learn calculus, we would founder in our
attempts to describe a large number of phenomina.  


--
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: friedman@hp-and.an.hp.com (joel friedman)
Newsgroups: comp.lang.c++
Subject: Any inheritance experts out there? reprise
Keywords: inheritance, virtual
Date: 18 Dec 92 16:17:18 GMT
Organization: Hewlett-Packard Company

Hello all,

I'd like to start off by thanking the many of you who provided me info about
the ARM.  I now have Stroustrup 2nd edition and it's just what I needed.  The
book I originally had was Stroustrup 1st edition, not a book by Dijikstra.  My
apologies for the mass confusion this caused!!

Down to business.  I need some assistance designing my class hierarchies for
the following situation:

I am writing device drivers for external memory devices.  I currently have to
support two types devices (say A and B), but that number could grow.  The
functions each device must support are common, but the implementations used to
provide them are quite different for each.  The type T below can be a char xor
a short.  The following template class defines these core functions:

template <class T> class core_functions
{
public:
   T Read cell(int address);
   void Write_cell(int address, T data);
};


I want to design the hierarchy so I can easily add device C, D, E etc.  Here's
the catch.  How can I do this so that the application programs only need to see
the core_function class declaration; not the derived class declarations for A
or B.  I need to enhance the core_functions class so that the user can call a
core_functions function, and it will be directed to the implementation in the
proper derived class (A or B).

If I derive A or B from core_functions, then the application must declare
objects of type A or B, thus they will need to have access to the derived class
declarations.

If I use A or B as a base class, then there have to be different derived
core_functions classes; one derived from A, the other from B.  This prevents
the user from seeing the declarations for A and B, but doesn't seem very
elegant.  I want to have only 1 core_functions class.

I tried making the core_functions functions virtual.  That let me call
core_functions functions, redirecting them to the implementations in A and B.
This didn't prevent the application from needing the A and B class
declarations, which is a requirement.

Any Ideas?? Thanks in advance.
Joel
-- 
__________________________________________________________________________
Joel Friedman           friedman@hp-and.an.hp.com           (508) 681-2709

 ///  /_ _  \\\   H E W L E T T          Imaging Systems Division
(((  / //_/  )))                         3000 Minuteman Road
 \\\   /    ///   P A C K A R D          Andover, Massachusetts 01810-1087

#include <standard_disclaimer.h>
__________________________________________________________________________
From: x9999bvj@maple.circa.ufl.edu
Newsgroups: comp.lang.c++
Subject: & of inline functions
Date: 13 Dec 92 18:53:10 GMT
Reply-To: X9999BVJ@oak.circa.ufl.edu
Organization: Center for Instructional and Research Computing Activities


What is the official method for handling taking the address of an inline
function?  For example, if you do this:

inline void Hello( void )
{
   puts("Hello");
}

void HelloFnc( void (*fnc)(void) )
{
   fnc();
}

void main( void )
{
   HelloFnc( Hello );
}
Newsgroups: comp.lang.c++
From: danyang@bbc.Stanford.EDU (Dan Yang)
Subject: question regarding to template
Keywords: friend, private member, template
Organization: Stanford University
Distribution: su
Date: Fri, 11 Dec 92 22:57:33 GMT


-- 
Dan Yang


I would like to access private member of a template class through friend
declaration. But ATT compiler gave an compiler error. Here is the 
source code. Thank you for your help!!!


#include <stdio.h>

class B;

template <class c>
class A
{
  friend B;
 private:
  int i;
 public:
  A(c b) { i = b; a = b; };
  c a;
};


class B
{
 public:
  int f(A<int> a);
};


int B::f(A<int> a)
{
   printf("%d\n", a.i);
   return 0;
}

main()
{
   A<int> a(10);
   B b;
   b.f(a);
   return 0;
 }



The error message is :


CC  test.c:
"test.c", line 26: error:  B::f() cannot access  A <int >::i: private  member
"test.c", line 33: warning:  b used but not set
1 error



Newsgroups: comp.lang.c++
From: johnrp@well.sf.ca.us (John Panzer)
Subject: Re: Overriding the order of constructors?
Keywords: constructor ordering
Organization: Whole Earth 'Lectronic Link
Date: Mon, 14 Dec 1992 07:50:57 GMT

In article <robison1.724307343@husc10> robison1@husc10.harvard.edu (Keith Robison) writes:
>dembo@csri.toronto.edu (Prof. Ron Dembo) writes:
>
>
>
>>What is the rational for not allowing a programmer to override the
>>default calling order of constructors and initializers?  I see
>>the importance of having a well defined default.  However, why
>>shouldn't the ordering of the initilizers be significant?  
>
>
>	I believe you can effectively accomplish this dangerous
>goal by calling virtual functions in your constructors:
>
>
>class A {
>  A() { reroute(); do_A_ctor_stuff(); }
>  virtual void reroute(); { }
>}
>
>class B : public A {
>  B() {}
>  void reroute ()  { do_B_ctor_stuff(); }
>}
>
>
>This will cause B's reroute() to be executed before any 
>A constructing has occurred.
>

Are you certain?  I believe that A::reroute() will
be called if reroute() is called from within A's
constructor or destructor.  I think this is a
common C++ "gotcha" - it's certainly gotten me
in the past.

John Panzer
johnrp@well.sf.ca.us


Newsgroups: comp.lang.c++
From: erc@netcom.com (Eric Smith)
Subject: Re: IS C++ a language for the "average programmer"
Organization: Netcom - Online Communication Services (408 241-9760 guest)
Date: Tue, 15 Dec 1992 22:42:08 GMT

In article <15DEC199210345433@zeus.tamu.edu> sam4628@zeus.tamu.edu writes:
>Yes, but does OO _really_ allow you to tackle a more complex problem?
>Or does it just allow you a new "notation" which is conveniently adapted
>to the more complex type of problems?  I've never heard of a programming
>goal which absolutely required OO to achieve it -- however, there are
>a large number of math problems which algebra just cannot solve, no
>matter how you manipulate it (assuming, of course, that you don't start
>making simplifying assumptions/approximations).

In theory, you can do without OOP, but in practice, software development
is expensive, and your customers want your work to approach perfection
immediately, rather than waiting years for a more stable version.

Just consider all the software development companies that have gone broke,
still trying to get their software working years behind schedule, and you
will start to appreciate that every "convenience" is precious.  OOP vs
older programming languages is like airplanes vs boats.  You can cross
the ocean in a boat, but your competition will arrive ahead of you and
take over your market.

And that's the way it should be.  We can argue the merits of OOP vs
non-OOP, or C++ vs C, forever and never prove anything.  The proof will
come only from seeing which software development companies survive and
prosper over the long run.
Newsgroups: comp.lang.c++
From: rmartin@thor.Rational.COM (Bob Martin)
Subject: Re: Complexity in the eyes...V2.0
Organization: Rational
Date: Thu, 17 Dec 1992 22:38:55 GMT

andrew@tagsys.com (Andrew Gideon) writes:



>My solution (well, I don't claim that the original idea was mine):
>an error stack class.  This permits a function to push messages
>onto the stack as the error is propogated upwards.

...

>My coworker thinks this complex.  He'd prefer returning an integer.

...

>So...what is the opinion of the net?


To say that you are right and that he is wrong would be arbitrary.
Either solution might be appropriate depending upon the kind of
application.  However, in any application of reasonable complexity, I
would prefer your solution.  I think it is elegant, and easy to use
and provides a very nice mechanism for tracing an error to its source.

You might want to add parameters to the error stack too.  These
parameters could convey more context information.  Thus:

ErrStack e;
e.PushMessage("Device error");
e.AddParam(deviceAddress);
e.AddParam(errorCode);

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


--
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: warsaw@nlm.nih.gov (Barry A. Warsaw)
Newsgroups: comp.lang.c++
Subject: Re: Survey: File Extension
Date: 16 Dec 92 19:50:22 GMT
	<1992Dec14.211010.10318@rd.hydro.on.ca>
	<1992Dec15.145208.27600@wam.umd.edu>
Reply-To: warsaw@nlm.nih.gov (Barry A. Warsaw)
Organization: Century Computing, Inc.


BTW, my latest version of c++-mode.el will edit C++, ANSI, and K&R C
using the same settings for the (possibly subset of) mode variables.

It can be got from ftp.cme.nist.gov:pub/gnu/c++-mode.el
Newsgroups: comp.lang.c++
From: dembo@csri.toronto.edu (Prof. Ron Dembo)
Subject: Overriding the order of constructors?
Summary: Why can I not explicitly override the ordering of initilization
Keywords: constructor ordering
Date: 14 Dec 92 03:09:43 GMT



What is the rational for not allowing a programmer to override the
default calling order of constructors and initializers?  I see
the importance of having a well defined default.  However, why
shouldn't the ordering of the initilizers be significant?  In
the code below what I would have liked to see would be
-----------
B
A
C
-----------
rather than 
-----------
A
B
C
-----------
#include	<iostream.h>

class A
{
	public :
	A(void)
	{
		cerr << "A\n";
	}
};

class B
{
	public :
	B(void)
	{
		cerr << "B\n";
	}
};

class C : public A
{
	B	b;

	public :

	C(void) : b(), A()
	{
		cerr << "C\n";
	}
};

main()
{
	C	x;
}
Newsgroups: comp.lang.c++
From: ae2@cunixa.cc.columbia.edu (Amiran Eliashvili)
Subject: Re: question about "this"
Reply-To: ae2@cunixa.cc.columbia.edu (Amiran Eliashvili)
Organization: Columbia University
Date: Sun, 13 Dec 1992 04:17:38 GMT


Many thanks for all that replied.

/amiran
Newsgroups: comp.lang.c++
From: maxtal@extro.ucc.su.OZ.AU (John MAX Skaller)
Subject: Re: Improvements on C++?
Organization: MAXTAL P/L C/- University Computing Centre, Sydney
Date: Sat, 12 Dec 1992 14:43:01 GMT

In article <1992Dec9.124436.20197@druid.uucp> darcy@druid.uucp (D'Arcy J.M. Cain) writes:
>maxtal@extro.ucc.su.OZ.AU (John MAX Skaller) writes:
>>but one may need
>>	while(p=get()) { ... }
>>instead of
>>	p=get();
>>	while(p) { ... p=get();}
>>sometimes for speed and clarity.
>
>You can still do this without sacrificing speed and in fact enhance clarity:
>
>    while ((p = get()) != 0) {...}

	The five extra characters make this clearer?
>
>I write this way all the time, even on systems that don't warn about that
>construct.  It leaves no doubt in the future maintainer's mind exactly
>what I meant to do.
>

	This is a mixed metaphor, puting 'p=get()' in the while()
part is a C idiom, not requiring !=0 is a C idiom. Using

	p=get();
	while(p!=0) { ... p=get(); }

would be the 'pascal' like idiom. (I'm just making a light
comment, this is a stylistic issue we shouldn't start a war about..
try:

	WHILE not (p is 0) DO ... ENDDO

which is perfectly legal C (with macros) if you want to starty a war:-)

-- 
;----------------------------------------------------------------------
        JOHN (MAX) SKALLER,         maxtal@extro.ucc.su.oz.au
	Maxtal Pty Ltd, 6 MacKay St ASHFIELD, NSW 2131, AUSTRALIA
;--------------- SCIENTIFIC AND ENGINEERING SOFTWARE ------------------
Newsgroups: comp.lang.c++
From: nelsonc@aaron.cs.rpi.edu (Chris Nelson)
Subject: Re: Complexity in the eyes...V2.0
Organization: Rensselaer Polytechnic Institute, Troy, NY
Date: Thu, 17 Dec 1992 17:45:21 GMT

Andrew,

Here's a short note with a vote: I prefer your error stack class.  I
think it's slick and I'd love to have a copy!  (I'll embellish on
request.)

                                      Chris



-- 
------------------------------+------------------------------------------
Chris Nelson                  |  Rens-se-LEER is a county.
Internet: nelsonc@cs.rpi.edu  |  RENS-se-ler is a city. 
CompuServe: 70441,3321        |  R-P-I is a school in Troy!
Newsgroups: comp.lang.c++
From: westes@smurf.sti.com (Will Estes)
Newsgroups: comp.lang.c++
Subject: Re: Death of Borland C++ Compiler
Date: 19 Dec 1992 13:00:35 -0800
Organization: Mail Group
NNTP-Posting-Host: smurf.sti.com

In article <BzH1LF.9yA@ais.org> draper@ais.org (Patrick Draper) writes:
>In your case, it sounds like you've got memory bugs. The fact that you're
>using pointer->pointer->pointer type expressions indicates to me a hard to
>debug program. The compiler shouldn't have any trouble with these, I've
>never had these problems at all.
>
>Try using the 80386 debugger. It loads the program into the same memory
>address as DOS does from the command line. Any location dependent errors
>will show up as they do without the debugger.

Chaolin, you may also want to get the MicroQuill product "SmartHeap For
Windows".  From what I understand it has some outstanding features to
check for heap overwrites at run-time, as well as allowing you to use
malloc() for memory calls without wasting memory handles (i.e.,
SmartHeap does its own sub-allocation management of a single
GlobalAlloc() memory area).  

We have just received the product and haven't started using it yet, but
I hear good things from people who have used it.  Comments from other
users of this product are welcome.

-- 
Will Estes		Internet: westes@netcom.com
Newsgroups: comp.lang.c++
From: news@massey.ac.nz (USENET News System)
Subject: A Matrix Class
Organization: DSIR, Palmerston North, New Zealand
Date: Wed, 16 Dec 92 01:04:52 GMT

Has anybody written a set of matrix multiplication routines that use the
operator over riding capabilities of C++?  I need something like this for
some vector manipulations I'm doing, standard X Y Z H vectors and 4x4
matrices.  I need all the normal operations, like multiplication, addition,
dot and cross product.  If anyone out there has already done all, or some
of this, I would be extremely grateful if they would let me have their
source code, preferably be posting it here.

Thanks in advance

Colin Wilson-Salt
Newsgroups: comp.lang.c++
From: pete@borland.com (Pete Becker)
Subject: Re: Complex Addition.
Originator: pete@genghis.borland.com
Organization: Borland International
Date: Fri, 11 Dec 1992 23:29:54 GMT

In article <1992Dec11.170849.18525@rs6000.bham.ac.uk> pickerig@eee.bham.ac.uk (Guy Pickering) writes:
>In ARM, the code for the `+` operator for the complex class is given as:
>
>inline complex operator+(complex a, complex b)
>{
>  return complex(a.re+b.re,a.im+b.im)
>}
>
>In general, can I create an instance of a class in a member function and
>return the object? Doesn't the complex object go out of scope?
>

	Yes, it does.  But that's not the end of the inquiry.

	int add( int a, int b )
	{
	return a+b;
	}

	Here, too, the temporary goes out of scope, but the compiler knows how
to deal with that.  Same thing for an object of a user-defined type.

>Could I do this:
>
>SomeClass operator<<(SomeClass data, int places)
>{
>  SomeClass temp(data);		// Copy data to temporary object.
>
>  // manipulate temp internally to perform
>  // the << operation.
>
>  return temp;
>}
>
>Would this allow me to write:
>
>  value1 = value2 << 5;
>
>If both variables were of type SomeClass?
>

	Yes.

	-- Pete
From: dak@kaa.informatik.rwth-aachen.de (David Kastrup)
Newsgroups: comp.lang.c++
Subject: Re: Survey: File Extension
Date: 14 Dec 92 22:37:47 GMT
Organization: Rechnerbetrieb Informatik - RWTH Aachen
Distribution: world
NNTP-Posting-Host: kaa.informatik.rwth-aachen.de

bs@alice.att.com (Bjarne Stroustrup) writes:



>erc@netcom.com (Eric Smith @ Netcom) conjectures:

> > I think ... the name
> > C++ wasn't originally intended to be pronounced "see plus plus", as the
> > ++ operator was originally called the increment operator, and a lot of
> > C programmers considered people who called it "plus plus" to be
> > uneducated.  But that has gradually changed over the years, and now the
> > majority calls C++ "see plus plus" 

>C++ was always pronounced C plus plus.

And small wonder. All the people I know, when reading a program loud,
say "i plus plus", "plus plus i", and not "i postincremented" or
"i preincremented" for i++ and ++i.

Maybe the language was pronounced in one stage of development
"c dot operator plus plus open-paren zero close-paren" ? Ain't
that a worthy suggestion?
From: cshaver@informix.com (Craig Shaver)
Newsgroups: comp.lang.c++
Subject: Re: Need help implementic data structures of generic objects
Date: 11 Dec 92 23:32:53 GMT
Organization: Informix Software, Inc.

In article <1992Dec10.114636.16861@ucc.su.OZ.AU> maxtal@extro.ucc.su.OZ.AU (John MAX Skaller) writes:
>In article <42186@sdcc12.ucsd.edu> cs161feu@sdcc10.ucsd.edu (Anthony Minkoff) writes:
>>Hi.  Another question from a C++ neophyte.
>>
....
>>The approach that has been
>>suggested is:
>>
>>class Object {
>>    /* ...etc... */
>>};
>
>	Dont do this Smalltalk hack please. A queue of Objects is
>totally useless, since they are just Objects and not ever Widgets.

YES! Do that elegant Smalltalk thing.  Do not listen to C++ hacks and
bigots.  Put a little thought into it and do something (re)useful.

-- 
Craig Shaver  (cshaver@informix.com for now) (415)390-0654 (415)926-6407
Productivity Group POB 60458 Sunnyvale, CA  94088
Newsgroups: comp.lang.c++