HDTenEightyP/NetNews huggingface dataset:
From: russw@cs.utexas.edu (Russ Williams)
Newsgroups: comp.lang.c++
Subject: Re: Best C++ Books -- Need Opinions!!!
Date: 12 Apr 1992 14:50:12 -0500
Organization: Great Northern Hotel
NNTP-Posting-Host: cs.utexas.edu
Summary: get Stroustrup & Meyers.

In article <1992Apr10.190239.23324@microsoft.com> jimad@microsoft.com (Jim ADCOCK) writes:
>		A Short List of Preferred C++ Texts

>The C++ Programming Language Second Edition, Stroustrup, 

>The Annotated C++ Reference Manual, Ellis & Stroustrup, Addison-Wesley 1990

>Effective C++, Scott Meyers, Addison-Wesley 1992 0-201-56364-9

Yes, these 3 are all good "must-haves".  I've not read Lippmann; I
hear good stuff about it, but everytime I look through it at the bookstore,
it looks like it doesn't have anything not in these.  Does it?

>A C++ Toolkit, Shapiro, Prentice Hall 1991, 0-13-127663-8
>	Similar to Hansen, but at a little easier reading level.
>	[I haven't decided which I like more.  Let me know which
>	you prefer.  People who want to see lots of C++ programming
>	examples should get both.]

I thought this book was awful!  It's riddled with typoes and errors,
e.g. he consistently mismatches new [] and delete (without []).  He
also talks a lot about bugs and quirks in early C++ translators which
are surely not of importance today.  The point of the book is mostly
to present lots of nice little class examples, but the other C++
books do it better.
I've bought a half dozen C++ books, and not only do I like this one the least,
it's the only one I actually actively dislike.

>Advanced C++ Programming Styles and Idioms, Coplien, Addison-Wesley '1992'

This one is pretty good, though also riddled with typoes, but not real
errors.  Coplien really goes off into the ozone near the end with the
bizarre advanced stuff that I can't imagine I'll ever need.  Another
quirk was that he used a few examples with arcane (to me at least)
subject matter (especially the network communication protocol one)
so that I had to spend time trying to understand the problem before
I could understand what the code was doing.  Too many books give trivial
examples, but I think Coplien may have erred in the other direction.
I got a lot out of the early parts, but then read Scott Meyers's
Effective C++ and think it does the basic stuff just as well.
I'd only get this book if you really need to do the weird Smalltalk
type stuff in C++, or are curious about how to do it.


Newsgroups: comp.lang.c++
From: alan@elroy.jpl.nasa.gov (Alan S. Mazer)
Subject: question re this and new
Organization: Image Analysis Systems Group, JPL
Date: Tue, 7 Apr 1992 23:24:11 GMT

If I have a virtual base class (with multiple inheritance) shouldn't the 
value of "this" in the constructor of a derived class be the same value
eventually returned by "new"?  It's not ("new" returns something 8 bytes
greater than "this" was in the constructor) and I'm not sure why.
-- 

-- Alan
   alan@elroy.jpl.nasa.gov
From: mab@mcdd1.uucp (Martin Bradford)
Newsgroups: comp.lang.c++
Subject: Re: Looking For CLOS on IBM-PC
Date: 8 Apr 92 08:15:50 GMT
Organization: McDonnell Douglas, Hemel Hempstead, UK

Try Software Engineer from Raindrop Software (U.S. 214-234-2611) - seems
to do what you want under Microsoft Windows. Costs about 250 dollars. I
haven't had a chance to evaluate it yet so can't comment on quality.

	Regards,

	Martin Bradford.
From: rmartin@willing.Rational.COM (Bob Martin)
Newsgroups: comp.lang.c++
Subject: Re: A coding style question
Date: 16 Apr 92 20:22:01 GMT
Article-I.D.: willing.rmartin.703455721

skip@taygeta.oc.nps.navy.mil (Skip Carter) writes:

>	If the functions EBCDIC_to_ASCII and ASCII_to_EBCDIC
>	get pass all data in/out by the parameter list should they be made
>	private members of the class or  should they be removed from the
>	class specification and be made ordinary static functions ?		
Functions which are useful to a general audience, should not be
confined within a particular class.  However, it sometimes makes sense
to put them into a structure which Booch calls a "class utility":

class CharacterConversions
{
    static void EBCDIC_to_ASCII(char*, int);
    static void ASCII_to_EBCDIC(char*, int);
};

This helps to keep the global name space from being polluted.  You can
call these functions as follows:

	CharacterConversions::EBCDIC_to_ASCII(c,7);


--
+---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.   |
From: easchwei@eos.ncsu.edu (ERIC ARNOLD SCHWEITZ)
Newsgroups: comp.lang.c++
Subject: Re: A really good way to do this is?
Date: 14 Apr 92 13:39:07 GMT
Reply-To: easchwei@eos.ncsu.edu (ERIC ARNOLD SCHWEITZ)
Organization: Project EOS - North Carolina State University

Thanks for all the advice/comments.  It seems there is no "really good
way to do this" -- that is, barring tricks or language extensions, etc.
It seems the best idea offered was to use two classes, one as an accessor
class and the other to provide the functionality.

Now, if I can only convince my boss to buy an Eiffel compiler... :-)
(I guess we'll just live with the yuckiness of it all.)

Eric.
Newsgroups: comp.lang.c++
From: mlanett@void.ncsa.uiuc.edu (Mark Lanett)
Subject: Re: AT&T Class Library with MPW??
Organization: University of Illinois at Urbana
Date: Sat, 11 Apr 1992 02:08:44 GMT

martin@cicada.volvo.se (Martin Borjesson) writes:

>Anyway, have anyone successfully used AT&T Class Library on the
>Apple Macintosh with MPW??? 

What *is* the AT&T Class Library?
-- 
Mark Lanett, Software Tools Group, NCSA           mlanett@uiuc.edu or  NCSA.STG
"People wander in and out of virtual rooms in virtual settings with virtual
characters and virtual money and virtual armor and virtual weapons, which is
virtually a good way to spend time, but not quite." -- Usenet Oracle
-- 
Mark Lanett, Software Tools Group, NCSA           mlanett@uiuc.edu or  NCSA.STG
"People wander in and out of virtual rooms in virtual settings with virtual
characters and virtual money and virtual armor and virtual weapons, which is
virtually a good way to spend time, but not quite." -- Usenet Oracle
From: pauls@parst1.uucp (Paul  Strydom)
Newsgroups: comp.lang.c++
Subject: Templates in n++
Date: 15 Apr 92 17:38:16 GMT
Article-I.D.: parst1.Apr15.104332.16740
Organization: Paradigm Systems Technology


I am considering using C++ for a project which has to be portable accross:

	*	AIX (RS6000),

	*	SCO Unix/386,

	*	OS2 and 

	*	DOS platforms.

(I have g++ available on most of these platforms.)

However the possibility that g++ may have some non-standard attributes
(speaking of standard C++ 3.0 features) must be clarified before I can 
consider using g++ as a tool.

For instance, I am in the dark concerning the portability of template 
implementations in different C++ compilers.

I have recently experimented with templates on Borland's C++ with 
fair success and the mechanism is a pure pleasure.

Could anyone perhaps shed some light on templates and g++ standards 
conformance in general ?

(A g++ template example would be appreciated.)

Thanks in advance

Paul Strydom

-- 
Paul Strydom                | 
Paradigm Systems Technology |
Pretoria, South Africa      | UUCP : pauls@parst1.UUCP                 
++27-12-342-2835            | BANG : ..!ddsw1!olsa99!tabbs!parst1!pauls
Newsgroups: comp.lang.c++
From: xjzhu@watmath.waterloo.edu (Xiaojun Zhu)
Subject: Dynamically allocate 2-dimensional array using new in Turbo C++.
Organization: University of Waterloo
Date: Mon, 13 Apr 1992 00:26:05 GMT

Hi, world:

Long time ago, I had problems in C to dynamically allocate 2-dimensional
array, now, I knew how to do that in C, but I got confused now when I
try to use new instead of malloc or calloc.
           ^^^            ^^^^^^    ^^^^^^

I tried several ways to do in Turbo C++(v1.0), and all of them 
compiled OK, but some of them has the following running time messages:
NULL POINTER ASSIGNMENT. I would like to know the real cause of the
problem.

...
#include<calloc.h>
...
int **ARRAY; //external definition without knowing the size
...
main()
{
   ...
   int SIZE;

   //Method1:(C)---works fine
   ARRAY=(int**)malloc(SIZE*sizeof(int*));
   for(int i=0; i<SIZE; i++)
      ARRAY[i]=(int*)malloc(SIZE*sizeof(int));

   //METHOD2:---seems working fine
   ARRAY=new int[SIZE];
   for(int i=0; i<SIZE; i++)
      ARRAY[i]=new int[SIZE];

   //METHOD3:---compiles OK, run time problem. See above.
   ARRAY=new (int**)[SIZE];
   for(int i=0; i<SIZE; i++)
       ARRAY[i]=new int[SIZE];

   //METHOD4:---same problem as METHOD3
   *ARRAY=new (int*)[SIZE];
   for(int i=0; i<SIZE; i++)
      ARRAY[i]=new int[SIZE];
}

I guess that I am missing some points here. Please help me out.
Thanks a lot.

Newsgroups: comp.lang.c++
From: sdm@cs.brown.edu (Scott Meyers)
Subject: Fuzzy Tools
Organization: Brown University Department of Computer Science
Date: Fri, 17 Apr 1992 14:30:47 GMT

I'm in the midst of converting my system from cfront 2.1 to cfront 3.0, and
in the process I'm redesigning certain things to use templates.  In some
cases this is a major redesign, and the end result is that for the time
being, the system, as a whole, will not compile.  Nonetheless, I'd like to
be able to view the inheritance hierarchy graphically, because that's just
the kind of view that would help me during my redesign.  I have a nice
class browser available -- cbrowse, from FIELD (plug, plug) -- but cbrowse
runs off a database, and the database is generated by tools that parse
source files.  Some of my source files are semantic disasters right now, so
they can't be parsed by a C++ compiler.  That means no database, and no
database means no data for cbrowse.  In short, until my system will compile
in its entirety, I can't use cbrowse or any other of the FIELD tools.

A different approach is to do "fuzzy" parsing -- only look for the
syntactic stuff that matters.  For a class browser, not a whole lot
matters, so, for example, InterViews' class browser iclass can show me my
inheritance hierarchy without any trouble.  Unfortunately, it only gives a
textual view, and it only shows three levels of the hierarchy at a time (a
class, its base classes, its derived classes).  I really want a graphical
view of a large part of the entire inheritance hierarchy.

First question:  does anybody know of a tool -- commercial or research or
whatever -- that can graphically display the inheritance hierarchy of a
system that won't compile?  

Second question: does anybody know of other tools that use "fuzzy" parsing?
For example, a pretty-printer for C++ certainly doesn't need a full parse,
but I'm unaware of a pretty-printer for C++ that actually works very well
for me (I've tried both the updated indent as well as emacs C++ mode
(including the new one in beta release)).  Another example would be one of
the .h-file-to-man-page programs, which I have not tried.  What other tools
in this genre are available, and how far can this notion of fuzzy parsing
be pushed?  Given that C++ is slow and hard to parse, it would be
interesting to know how much mileage (kilometerage?) we can get out of
cheating.

Scott


-------------------------------------------------------------------------------
What do you say to a convicted felon in Providence?  "Hello, Mr. Mayor."
Newsgroups: comp.lang.c++
From: mattw@picasso.cssc-syd.tansu.oz.au (Matthew Watson)
Subject: Re: OO Structured Design Question
Organization: Telecom Australia
Date: Tue, 14 Apr 92 05:11:19 GMT

chrism@col.hp.com (Chris Magnuson) writes:

>Is there a *standard* object-oriented structured design notation?  I'm looking
>for the object-oriented equivalent of the Yourdon notation from the book
>Structured Design for procedural languages.

>I have read some articles that use a notation suggested in a book by Rumbaugh,
>but I'm wondering if there are others, or if this particular notation is
>*non-standard.*

>Thanks in advance,
>Chris Magnuson
>chrism@col.hp.com

There is also a semi-standard in a book by Grady Booch (works for
Rational). I have only read parts of Booch and seen some Rumbaugh diagrams
but Booch seems to have a more layered approach, taking you through the
whole analysis and design of a system whereas Rumbaugh seems to be more
interested in strictly class diagrams. A Rumbaugh tool has been made by
Versant which produces code skeletons but seems to start when most
analysis and design has been completed. Rational are producing a tool for
the Booch method now which shows greater promise but may be delayed
further by all the features thay want to give it. Would be great if it was
completed though! Rationals' tool actually uses versants OODB for
implementation! (Gives you a run-time licence).
-------------------------------------------------------------------------------
     -  Matthew Watson -  	   | MHSnet: mattw@cssc-syd.tansu.oz.au
     Australian and Overseas	   |
  Telecommunications Corporation   | Snail : 9th Floor, 320 Pitt Street
         Network Services	   |        Sydney, Australia 2000.
  Customised Software Solutions    |  or 115 Mitchell Rd Alexandria 2015.
Newsgroups: comp.lang.c++
From: checker@acf3.nyu.edu (Christopher Hecker)
Subject: Re: implementing [][] for a 2-D array
Organization: New York University
Date: Thu, 16 Apr 1992 05:37:56 GMT


I was recently playing around with using templates to generate the
intermediate classes for a multidimensional operator[].  I posted the
code on BIX, if anyone is interested.  It isn't too useful in the real
world because it relies on a BC++ template bug to work.  Comeau 3.0
(cfront) refuses to compile it.  I had it so that you could define
arrays like this:

array<int,5> aMy5DArray;
 
this would instantiate a template that generated 5 'subclasses' to 
allow you to access the elements.  It had the added benefit of giving a
compile time error on bad accesses (like accessing a 3D array with only
two []'s).

Neat to play with, but I wouldn't want to base an application around it.

Chris
From: rmartin@willing.Rational.COM (Bob Martin)
Newsgroups: comp.lang.c++
Subject: Re: OO Structured Design Question
Date: 14 Apr 92 23:32:27 GMT

chrism@col.hp.com (Chris Magnuson) writes:

>Is there a *standard* object-oriented structured design notation?  I'm looking
>for the object-oriented equivalent of the Yourdon notation from the book
>Structured Design for procedural languages.

>I have read some articles that use a notation suggested in a book by Rumbaugh,
>but I'm wondering if there are others, or if this particular notation is
>*non-standard.*

There are several notations competing for ascendancy in the OOD milieu.  

The "Booch Notation" is described in the book:
	"Object Oriented Design with Applications" by Grady Booch.

The "Rumbaugh Notation" is described in the book:
	"Object Oriented Modeling and Design" by James Rumbaugh, et. al.

The "Wirfs-Brock" notation is described in the book:
	"Designing Object Oriented Software" by Rebecca Wirfs-Brock, et. al.

The Coad-Yourdon notation is described in the book:
	"Object Oriented Design" by Peter Coad and Edward Yourdon"

It is remarkable to me that in the infancy of the OO paradigm, four
distinct notations have so quickly come to the fore.  I believe it is
a reflection that the technique yeilds to concepts which are more
susceptable to manipulation by notational conventions.

Of the four notations mentioned above, Booch and Rumbaugh are by far
the most elaborate.  And Booch more so then Rumbaugh. 

In my humble opinion (as little as that may be worth) The Booch
notation is the superior notation.  It allows a very large number of
design decisions to be represented in a very dense but readable form.
It includes notations for classes, objects, relationships, access
rights, friendship, multiple inheritance, virtual inheritance,
parameterized classes, class utilities, source modules, subsystems,
processes, devices, etc..  It is the only notation that I know of that
deals with the aspects of "physical design" i.e. the design of the
development environment, source file visibility and configuration
management.


--
+---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.   |
From: mamisra@pollux.usc.edu (Manavendra Misra)
Newsgroups: comp.lang.c++
Subject: Passing C++ member function pointers to UNIX routines: help!
Date: 8 Apr 1992 19:24:55 -0700
Organization: University of Southern California, Los Angeles, CA
NNTP-Posting-Host: pollux.usc.edu
Keywords: member functions UNIX


Has anybody tried passing pointers to class member functions, instead of
regular functions pointers, to UNIX system calls ? 

For example, a UNIX function like 'lwp_create' where its second argument is
a (*func)()

And more generally to do the following, (but without having to specify
the class name 'B' in the 'init' declaration of class A).

class A
{
	void (*func)();
public:
	A();
	init(B* obj,void (B::*f)())
	{
		(obj->*f)();
	}
};

class B
{
	A a;
public:
	B() { a.init(this,&B::exec); }
	void exec();
}


Any suggestions are welcome, including having class B as a derived class,
let's say C, where class A knows about C (but not about B)

Please send your responses by email to "alfredo@bufo.usc.edu".

Thanks very much.

Alfredo.
From: John.Furlani@East.Sun.COM (John L. Furlani)
Newsgroups: comp.lang.c++
Subject: ? Templates in a large development environment
Keywords: templates, large, environment, development
Date: 13 Apr 92 22:33:14 GMT
Reply-To: John.Furlani@East.Sun.COM
Organization: Sun Microsystems
NNTP-Posting-Host: quixote.east.sun.com
Originator: jlf@quixote

Does anyone have suggestions or schemes that successfully allows templates
to work in a large development environment such that functions are
properly instantiated?

I would like to build a library that uses templates.  In order for any
application to use this library, the template instantiations must be
kept in the library.  So, I force instantiation by doing a CC command
prior to creating the archive and then include the .o files into the
library.

This works ok until another application that uses the same template 
functions (and constructors and operators, etc.) try to link with this
library.

When this occurs, the link fails because many things are multiply 
defined.  For some reason, even though the functions are instantiated
in the library, the applications and other libraries reinstantiate 
the template functions.

I have read a couple off papers by Glen McClusky that describes template
instantiation.  He doesn't really discuss what can be done in a large
development environment with multiple libraries and applications all
trying to synchronize template instantiation.

If you have any suggestions or successful (or unsuccesful) experience 
with template instantiation in a large development environment, I would
like to hear about your experiences.

If it seems approprite, I will post a summary.

j.




-- 
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
John L. Furlani                                    VIPER
MaBell:		(919)460-8383                      Sun Microsystems
Internet:	john.furlani@East.Sun.COM          P.O. Box 13447
From: swillden@cc.weber.edu (Shawn)
Newsgroups: comp.lang.c++
Subject: Re: Brainteaser
Date: 7 Apr 92 01:39:00 GMT
Organization: Weber State University ComSci Department
News-Software: VAX/VMS VNEWS 1.4-b1

In article <1992Apr4.235857.26870@taumet.com>, steve@taumet.com (Steve Clama writes...
>tom@ssd.csd.harris.com (Tom Horsley) writes:

[ Question about a hypothetical function that could decide at run-time if
	it had been expanded inline ]

>In the spirit of the question:
> 
>1.  You can write and use the function such that its side effects
>    will occur in a different order depending on whether it was
>    expanded inline.  This is not portable, and will have to be
>    carefully tuned for each release of each compiler you try it
>    with.  (It also violates language rules, but you didn't say it
>    had to be legal.)

This sounds interesting... Example??  I find I can learn a lot about rules by
seeing them broken :-)

>3.  Call the "inline" function with the address of a local variable,
>    and compare this with the address of a variable local to the
>    "inline" function.  You should be able to arrange things to tell
>    whether they are too close together to be in different activation
>    records (stack frames).  If they are close together, the function
>    was expanded inline.  (This also violates language rules.)

I can see how this could be done, what rules does it violate?

>-- 
> 
>Steve Clamage, TauMetric Corp, steve@taumet.com
>Vice Chair, ANSI C++ Committee, X3J16

Shawn Willden
swillden@cc.weber.edu
Newsgroups: comp.lang.c++,comp.std.c++
From: krc@wam.umd.edu (Kevin R. Coombes)
Subject: Access specifiers, two layers deep
Originator: krc@rac1.wam.umd.edu
Keywords: Access, private derivation
Organization: University of Maryland at College Park
Date: Mon, 6 Apr 1992 15:52:33 GMT

I've run into another disagreement between compilers. Here's the
simple example:

	class Base {
	    public:
		int b;
	};

	class Intermediate : public Base {
	    public:
		int i;
	};

	class Derived : private Intermediate {
	    public;
		Intermediate::i;       // okay
		Intermediate::b;       // mysterious
		Base::b;               // error
	};

The line labelled "okay" is accepted by both compilers. The line labelled
"error" is flagged by both compilers, since it is not the name of a mem
allowed by one compiler but is flagged as an error by the other compiler.
The error message complains that there is "No type specifier for member b"
and there is an "Undeclared member name b". I've looked at the relevant
section of the ARM, but all the examples deal with immediate base classes.
Does anyone have a compelling reason for believing one of these compilers
rather than the other?

Thanks,
Kevin Coombes <krc@math.umd.edu>
From: jbn@lulea.trab.se (Johan Bengtsson)
Newsgroups: comp.lang.c++
Subject: Re: Borland's design decisions
Date: 13 Apr 92 12:26:20 GMT
Organization: Telia Research AB, Aurorum 6, 951 75 Lulea, Sweden

strider@concour.cs.concordia.ca (GEORGAKAKIS peter) writes:
: 
: I view iterators as objects that maintain currency on a collection and
: tell the collection what what current element they are pointing to
: when queried by the collection.  Furthermore collections know what
: iterators are iterating over them and can properly adjust the
: iterators when necessary (that is when the collection is modified).

This will (should) not work with const collections.  Someone suggested
using both iterators and "manipulators", that are iterators with
insert/remove operations.

-- 
--------------------------------------------------------------------------
| Johan Bengtsson, Telia Research AB, Aurorum 6, S-951 75 Lulea, Sweden  |
| Johan.Bengtsson@lulea.trab.se; Voice:(+46)92075471; Fax:(+46)92075490  |
--------------------------------------------------------------------------
From: andyrose@wet.UUCP (Andrew Rose)
Newsgroups: comp.lang.c++
Subject: g++ install IRIS
Date: 10 Apr 92 00:38:35 GMT
Organization: Wetware Diversions, San Francisco

Newsgroups: comp.lang.c++
Subject: install g++ on IRIS
Summary: 
Followup-To: 
Distribution: world
Organization: Wetware Diversions, San Francisco
Keywords: 

Hello.  
I have received a g++ install tape and have put some 30 hours into 
installing it on a SGI personal IRIS.

.Changed Makefile for SysV. Also made changes from HINTS.  
Built gcc and it works.  g++ compiles.
After adding #define COLLECT at the beginning of tm-mips.h,
my main concern at the moment has to do with collect being unable to find
the routine mips_asm_file_start which exists in mips-output.c.  I'm also
unsure of the role crt1+ plays in all this.

Any suggestions appreciated, Mail would be fine, phone call would be great.

Thanks - Andy
415 495 5595

Newsgroups: comp.lang.c++