HDTenEightyP/NetNews huggingface dataset:
From: rmartin@thor.Rational.COM (Bob Martin)
Newsgroups: comp.lang.c++
Subject: Re: Novice? question: Designing for mul
Date: 27 Jul 92 21:03:20 GMT

maxtal@extro.ucc.su.OZ.AU writes:


|In article <rmartin.711299360@thor> rmartin@thor.Rational.COM (Bob Martin) writes:
|>
|>But as I explained in a previous posting, mixin of pure virtual
|>functions through DAGs is not precluded, the derived class must simply
|>resolve the ambiguities by declaring the functions and routing them to
|>the appropriate base.  Inconvenient, but not a disaster.


|	And there are no ambiguities PLEASE read the section
|in the ARM on name dominance, look at the examples
|of sibling calls given there, and THEN read the definition
|of abstract classes.

As I explained in my previous posting, the ambiguity is in the ARM.
It does not make it clear whether inheriting a pure virtual function
from one side of the DAG is overriden by an impure virtual function on
the other side of the DAG.

Oh it makes sense to do this, maybe.  But the ARM leaves the question
open.  

|This whole issue was argued out before. I started it.
|Borland agrees it is a bug to be fixed. Others have
|confirmed that this makes sense. How else could
|you possibly interpret the definition of
|ABSTRACT class?

An abstract class is a class with a pure virtual function, either
specified or inherited.  If you are inheriting from two classes, one
of which has a pure virtual, and the other has the same virtual
function, but impure, should be base be abstract or not?  Is the pure
virtual inherited, or are impure virtuals inherited preferentially to
pure virtuals.  

I am leaning with your interpretation, that the impure should be
inherited preferentially, and that the class should not be abstract.
But I don't think the issue is as clear cut as you claim.  For
example, I could pose the following argument:

In any case where a pure virtual and an impure virtual can be
inherited through separate branches of the DAG, the pure virtual
should have preference since it makes an unambiguous statement that
the function should be overridden in the *derived* class.  Since
inheriting the impure is not the same as overriding, it should not be
inherited.

Maybe you don't agree with that argument.  I am not sure I do either.
But it does demonstrate that the issue could be debated.



|-- 
|;----------------------------------------------------------------------
|        JOHN (MAX) SKALLER,         maxtal@extro.ucc.su.oz.au
|	Maxtal Pty Ltd, 6 MacKay St ASHFIELD, NSW 2131, AUSTRALIA
|;--------------- SCIENTIFIC AND ENGINEERING SOFTWARE ------------------
--
+---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: bright@nazgul.UUCP (Walter Bright)
Newsgroups: comp.lang.c++
Subject: Re: Power Operator vs NANs
Keywords: ansi net
Date: 20 Jul 92 18:01:04 GMT
Reply-To: bright@nazgul.UUCP (Walter Bright)
Organization: Zortech, Seattle

In article <1992Jul15.031449.1223@ucc.su.OZ.AU> maxtal@extro.ucc.su.OZ.AU (John (MAX) Skaller) writes:
/In article <819@nazgul.UUCP> bright@nazgul.UUCP (Walter Bright) writes:
/>I strongly agree that the C++ committee should look at handling NANs,
/>infinities, and other common floating point characteristics before getting
/>all hot and bothered about power operators. It is difficult to do robust
/>floating point apps without dealing with NANs and infinities, and it is
/>a shame that they are largely ignored by C++ compiler vendors. Zortech has
/>had them implemented for the last year, and no, it isn't difficult at all
/>to implement and it doesn't step on anything else either.
/	Would you be prepared to post the specs? What 
/operators are used, etc?

I don't have the specs in electronic form. But they have been included in
the latest ANSI C++ mailing.

The additional operators are:
	<	less
	>	greater
	<=	less or equal
	>=	greater or equal
	==	equal
	!=	unordered, less or greater
	!<>=	unordered
	<>	less or greater
	<>=	less, equal or greater
	!<=	unordered or greater
	!<	unordered, greater or equal
	!>=	unordered or less
	!>	unordered, less or equal
	!<>	unordered or equal


Unordered means one or both operands is a NAN.
From: proberts@informix.com (Paul Roberts)
Newsgroups: comp.lang.c++
Subject: NetClasses? - info sought
Date: 28 Jul 92 20:48:06 GMT
Organization: Informix Software, Inc.
Originator: proberts@moose


    I am doing distributed programming using C++ and am in need of a
communications library to send objects over a network.  I remember
seeing something about a product called Netclasses (sp?), that
supposedly does this.  Can somebody post or send me more information
about it or other products that support the transport of objects.
Thanks in advance,

Paul Roberts
Newsgroups: comp.lang.c++,comp.std.c++
From: bobm@Ingres.COM (Bob McQueer)
Subject: Re: Language extensions for run-time type identification
Date: 28 Jul 92 23:36:54 GMT

In <l7b2krINN10u@exodus.Eng.Sun.COM>,
	dated 28 Jul 1992 17:57:47 GMT,
	chased@rbbb.Eng.Sun.COM (David Chase) writes:
> >... when I want to know at run time if
> >an object is of a particular class, what I really want to ask is "is it this
> >class, or any class derived from it?", which implies somebody taking the
> >vtable (enhanced into class descriptor) pointer in the ...
> 
> Do be careful not to confuse the desired meaning of "X is a Foo" with
> how it is actually implemented.  For single inheritance, the best
> implementation is probably not what you think it is . ...

Point taken.  You are correct.  However, the question I want to ask still
stands, and a simple comparison of my vtable pointer with the pointer for
a given class isn't sufficient, which was the point I really wanted to make.
There possibly are more efficient ways to do it than to ascend through the
tree to the original base class given any underlying implementation.  Again,
this underscores the need to think through this within the language definition,
rather than having everybody reimplement it in their favorite ad-hoc manner.
Newsgroups: comp.lang.c++,comp.lang.c
From: kale@m.cs.uiuc.edu (L. V. Kale')
Subject: Re: Population count.
Organization: University of Illinois, Dept. of Comp. Sci., Urbana, IL
Date: Wed, 22 Jul 1992 17:01:32 GMT


Here is a simple code-fragement that counts the number of 1's in
a word stored in x.

int x, count;
...
count = 0;
while (x) { count++; x = x & (x-1); }

Nice things about this: uses only two variable which can be expected to be in
registers (unlike the lookup table).
Also, loops only as many times as the number of ones. This is good
for words with very few ones.

The algorithm was taken from "Combinatorial Algorithms" book, by 
Reingold, Nievergelt and Deo.
I used this in a primes-sieve program for counting the number of primes
in a bitvector.

-- 

kale@cs.uiuc.edu
L.V. Kale
Dept. of Computer Science
Xref: sparky comp.lang.c++:11852 comp.std.c++:1006
From: tmb@arolla.idiap.ch (Thomas M. Breuel)
Newsgroups: comp.lang.c++,comp.std.c++
Subject: Re: run-time type checking, freezing, and thawing
Date: 31 Jul 92 20:58:14 GMT
	<2TJ53BQ@netmbx.netmbx.de> <2A78457A.561C@tct.com>
	<FAM5HFE@netmbx.netmbx.de>
Reply-To: tmb@idiap.ch
Followup-To: comp.lang.c++
Organization: IDIAP (Institut Dalle Molle d'Intelligence Artificielle
	Perceptive)
In-reply-to: jrobie@netmbx.netmbx.de's message of 31 Jul 92 12:49:56 GMT

In article <FAM5HFE@netmbx.netmbx.de> jrobie@netmbx.netmbx.de (Jonathan Robie) writes:

   chip@tct.com (Chip Salzenberg) writes:
   >According to jrobie@netmbx.netmbx.de (Jonathan Robie):
   >>RTTI is needed to properly freeze a C++ object into a "dead array of
   >>bytes" ...
   >Virtual functions are sufficient for freezing.

   Somebody out there is not listening.  When I say "necessary" I do not
   mean that it is impossible for an application programmer to write lots
   of code that I could use to do a task.  I simply mean that this info is
   not out there unless the compiler or the application programmer supplies it.

For many classes it is simply wrong to use structural type information
for "freezing" (just as it is wrong in general to use structural type
information for determining equality). At the very least, the
implementor of a class should be able to specify whether and to whom
structural type information about a class should be accessible.

Note also that you do not need runtime typing to make structural I/O
work. You could provide generic structural I/O that requires knowledge
of the object's type at compile time and does not have to rely on
runtime type tags (as opposed to polymorphic structural I/O that
requires RTTI).

					Thomas.
Newsgroups: comp.lang.c++
From: whaley@jazz.concert.net (Jonathan Whaley)
Subject: Advanced C++ Training Classes?
Organization: Center for Communications, MCNC; RTP, NC
Distribution: usa
Date: Wed, 29 Jul 1992 19:03:32 GMT

I'm interested in attending an advanced C++ workshop and I wanted 
to get opinions from the net on the best available workshops.
I'm considering attending the (Addison-Wesley) Technology Exchange
Company Advanced C++ workshop. At over $1500 for 4 days I want to
make sure I'm getting my money's worth. Can anyone tell me something
good/bad about it? How the instructor was...how helpful the labs were...
what kind of equipment you used...Is the instructir Michael Vilot?

thanks for the info.
--
Jonathan Whaley - MCNC Center for Communications
(919) 248-1165  - PO Box 12889 - 3021 Cornwallis Road
whaley@concert.net - Research Triangle Park, NC 27709-2889
From: daniel.edelson@inria.fr (Daniel R. Edelson)
Newsgroups: comp.lang.c++
Subject: Re: delete versus delete[] (was Re: leakmeister)
Date: 21 Jul 92 08:18:49 GMT
Reply-To: Daniel R. Edelson <daniel.edelson@inria.fr>
Organization: INRIA -- Institut National de Recherche en Informatique et Automatique -- Rocquencourt, France

In article <1992Jul19.162429.4307@usenet.ins.cwru.edu>, aa753@cleveland.Freenet.Edu (Bob Jarvis) writes:
|> 
|> This should work correctly.  The only time that the 'delete []' syntax is
|> required is if you have a dynamically-allocated array of class instances
|> which have a destructor you want to have invoked for each class instance
|> in the array.  

Nonetheless, the effect of deleting an array with the plain delete syntax
is undefined. The definition of such "undefined behavior" is "an error that
the compiler is not required to diagnose." 

It is not difficult to think of times when this can
lead to problems, even for a class that doesn't have a
destructor. Suppose that the class overloads new and
delete to use a customized memory allocator. Allocating
the array with `new T [x]' will call the global operator
new and obtain memory from the standard place, whereas 
deleting it without the array syntax will return the memory
to the custom allocator. This is not what you want to happen.

daniel.edelson@inria.fr
From: ark@alice.att.com (Andrew Koenig)
Newsgroups: comp.lang.c++
Subject: Re: Renew?
Date: 26 Jul 92 23:06:28 GMT
Reply-To: ark@alice.UUCP ()
Organization: AT&T Bell Laboratories, Liberty Corner NJ

In article <memo.542965@cix.compulink.co.uk> vadim@cix.compulink.co.uk writes:

>   ObjWithRenew *p; 
>   p = (ObjWithRenew *)realloc(old, newsize);
>   p->renewed(s);  // We can do this because realloc copied
>            // the vptr too

No such luck.  People are entitled to write classes whose objects,
for example, store their addresses in other data structures.  In general,
you cannot expect to be able to copy the bits that represent an
arbitrary object from here to there without breaking things.

Moreover, implementations that use pointers rather than offsets to
locate virtual base classes are guaranteed to break under such movement.
That includes all cfront-based implementations.
-- 
				--Andrew Koenig
				  ark@europa.att.com
Newsgroups: comp.lang.c++
From: jimad@microsoft.com (Jim Adcock)
Subject: Re: Committee Members -> What do you think?
Date: 23 Jul 92 01:06:05 GMT
Organization: Microsoft Corporation

In article <1992Jul20.150341.5723@sco.COM> paul@sco.COM (Paul Jackson) writes:
|In article <1992Jul17.194202.14981@microsoft.com> jimad@microsoft.com (Jim Adcock) writes:
|>Your definition of what a "standard" "is" flies in the face of the reality
|>of the ANSI-C++ committees actions.
|
|The committee does have the mandate to fix "clear" deficiencies in the
|language. Most people feel that this included templates and exception
|handling. Many people feel that it includes little else. 

Then the committee is exceeding their mandate.  Your comments have no meaning
in the face of the reality of the committee activities, of which templates
and exceptions only represent a tiny part.

|I assure you that of all the customers of vendor X's compiler
|clamour for operator dot then vendor X WILL put it into their compiler.
|Vendor X is then likely to try and get it into the standard. 

On the contrary, even if Vendor X has lots of customer who want it, 
vendor X is unlikely to put it in their compiler while the extensions
committee is sitting on the proposal, insisting that if and when they
feel like getting around to it they're going to change the proposal to
something they consider better.  Again, s*** or get off the pot!   Either
propose something better, or get out of the way!

|Convince me that it is NECESSARY and I'll recommend that my companies rep
|vote for it. By necessary, I mean that you CANNOT implement "smart" classes
|without it.

If you read Coplien or my proposal or talk to anyone else who has implemented
any of these "smart" classes they will tell you that one "can" implement
smart classes "just" by writing forwarding functions for everything.
People do not do so because it is too tedious, and because it leads to 
stamp coupling of two classes, resulting in a maintainence nightmare. 
Therefore people implementing "smart" classes today, lacking operator.()
instead "punt" and overload operator->() instead, leading to confusing,
incorrect syntax.  Again, Coplien describes this problem in
many places in his book.  I suggest you read his book.

|Wrong. It changes the existing language and hence is, by the definition
|being used by the committee, an extension. All Humpty Dumpty arguments
|to the contrary don't impress me.

Again, your statements fly in the face of the reality of the committee's
actions.  If ALL "changes" to the language were equally routed through
the "extensions" committee and ALL changes to the language were equally
placed on the extensions WG queue for a couple years and if ALL changes
were required to be written up in detail by their proposers, subject to
days and days of "extensive" extensions WG detail analysis, THEN your
statements would make sense.  BUT, ON THE CONTRARY, there are many changes
to the language that are happening without going through the extensions
group.  The work of the libraries WG being one example.  "Humpty Dumpty"
const being another example....

Newsgroups: comp.lang.c++
From: torsten@daimi.aau.dk (Torsten B. Hagemann)
Newsgroups: comp.lang.c++
Subject: Re: Found references to A++
Keywords: Annotated C++, A++, assertions, preconditions, postconditions
Date: 29 Jul 92 10:54:19 GMT
Organization: DAIMI: Computer Science Department, Aarhus University, Denmark

weh@abasin.dr.att.com (William E. Hopkins) writes:

>I was able to find two references to what is known as Annotated C++ or A++
>(``Annotated C++'' made electronic searches match on every reference to the
>ARM, which is practically *all* C++ papers/books written since 1990...):

>Cline, M., and Lea, D., ``Using Annotated C++,'' C++ at Work, Secaucus, NJ,
>September 1990, p. 65.

>Cline, M., and D. Lea, ``The Behavior of C++ Classes,'' Symposium on
>Object-Oriented Programming Emphasizing Practical Applications (SOOPPA),
>Marist College, Poughkeepsie, NY, September 1990, p. 81.


>Unfortunately, those are not the easiest things to obtain (i.e., not in
>AT&T corporate library).  Does anyone know of any other reference (I do
>have librarians trying to get the above)?

>		Bill Hopkins

>P.S. Thanks to Mike Vilot for the pointer to the above in the class notes
>     he wrote for TEC's Advanced C++ programming course.

I know that these are not easy to find, I got them in postscript (complete
except for one figure) from Doug Lea. I am willing to email them to you if you
want them.

I have written a thesis on Assertions in BETA, which is also available in
postscript, if any should want it. 

Torsten
--
The flesh is willing, and the spirit is weak. 
Newsgroups: comp.lang.c++
From: maxtal@extro.ucc.su.OZ.AU (John MAX Skaller)
Subject: Re: Dimensional Type Checking
Keywords: dimensional analysis
Organization: MAXTAL P/L C/- University Computing Centre, Sydney
Date: Tue, 21 Jul 1992 14:48:19 GMT

In article <1992Jul20.101402.16526@hemlock.cray.com> dsf@cray.com (Dan Frankowski) writes:
>
>See IEEE Software, May 1988, pages 21-26, "Dimensional Analysis with
>C++."  They implement a "units" class that checks the dimensions and
>even converts automatically if there is a simple multiplicative factor
>(for example feet to inches, but not celsius to fahrenheit).
>
>The disadvantage is that it's all at runtime!  This means you don't get
>the line number where the error occurred, you need about 20 bytes of
>extra storage per variable-with-units (even in arrays, it's 20 bytes
>per element), it slows down execution, and so on.
>
>Is there a better way, folks?
>

	You can fix the array problem with lots of nasties.

	However, it SHOULD be possible to do dimmensional analysis
at compile time and it isnt. So to the experts: WHY NOT?

	What extension (to templates?) is required to allow this.

	[Um.. we need a reflexive system?]


-- 
;----------------------------------------------------------------------
        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: rjbodkin@theory.lcs.mit.edu (Ronald Bodkin)
Newsgroups: comp.lang.c++
Subject: Re: boolean (was: Re: typedef vs enum)
Date: 27 Jul 92 23:21:59 GMT
	<23239@alice.att.com> <1992Jul20.032111.22387@ucc.su.OZ.AU>
Organization: MIT Lab for Computer Science

In article <1992Jul20.032111.22387@ucc.su.OZ.AU> maxtal@extro.ucc.su.OZ.AU (John MAX Skaller) writes:
   NOW if you add f(bool), it gets called by preference.

	But then f(23) becomes f(TRUE), which might still cause
problems, as in:
int condition(int errno); // 0 = no error
int condition(bool ok); // TRUE = no error
		Ron
Newsgroups: comp.lang.c++
From: feustel@netcom.com (David Feustel)
Subject: ZTC 32-bit Dos Code Runs on OS/2 V2.0
Date: Sat, 25 Jul 92 14:37:29 GMT
Organization: DAFCO: OS/2 Software Support & Consulting


People who have both ZTC and OS/2 may be interested to know that
it is possible to run ZTC 32-bit code compiled with the -mx option in
a dos box under os/2. The key to doing this is to get the Flashtek
x32vm package ($69+shipping) which includes an IBM fix for VDPMI.SYS.
People running large programs will want to get the os/2 kernel patch
that eliminates the monotonically increasing swap file size.
-- 
Dave Feustel N9MYI <feustel@netcom.com>
---
What's the different between a Salem Witch Hunter and a modern day
Drug Warrior? - 3 centuries.
From: lagies@infoac.rmi.de (IBH Bernhard Hilpert )
Newsgroups: comp.lang.c++
Subject: c++ for embedded ssystems
Date: 26 Jul 92 15:39:18 GMT
Organization: RMI Net INFO.box Systems * Aachen * Hamburg * Flensburg


 
We are starting a project to develop software for the i960 and the
MIPS R3000/4000 processors and we are now looking for toolsets (compilers,
loaders, debuggers etc.)
1. Are their specific toolsets for c++ development available for those
   embedded controllers? Any information on practical usage appreciated.
 
2. Did somebody use cfront together with one of the available c-based
   toolsets (Intel, Mips, Tasking..)? Again, infos on practical usage very
   much appreciated.
 
3. I am also interested in general informations about problems that we
   have to expect, if we use cfront as part of a special c-based toolset
   for such an application.
 
 
Thank you.
Newsgroups: comp.lang.c++,comp.std.c++
From: sharma@euler.Warren.MENTORG.COM (Sharma Kunapalli)
Subject: Re: A question about the sizeof operator
Keywords: sizeof operator
Organization: Mentor Graphics Corp. - IC Group
Date: Fri, 31 Jul 1992 17:45:22 GMT

In article Message-ID: <drenze.712541103@icaen.uiowa.edu>
drenze@icaen.uiowa.edu (Douglass J. Renze) writes:

>I was playing around with the sizeof operator today, and I found out some-
>thing curious.
>
>The following program:
>
>#include <iostream.h>
> 
>class s1 {
>        struct name {
>                char last[10], first[10], mi;
>        };
>        s1* next;
>};
> 
>class s2 {
>        struct name {
>                char last[10], first[10], mi;
>        };
>};
> 
>int main(void) {
>        cout << "sizeof s1 = " << sizeof(s1) << '\n';
>        cout << "sizeof s2 = " << sizeof(s2) << '\n';
>        return 1;
>}
>
>produces the following output:
>
>sizeof s1 = 4
>sizeof s2 = 1
>
>Yet this next program...
>
>#include <iostream.h>
> 
>class s1 {
>        char last[10], first[10], mi;
>        s1* next;
>};
> 
>class s2 {
>        char last[10], first[10], mi;
>};
> 
>int main(void) {
>        cout << "sizeof s1 = " << sizeof(s1) << '\n';
>        cout << "sizeof s2 = " << sizeof(s2) << '\n';
>        return 1;
>}
>
>produces this next output...
>
>sizeof s1 = 26
>sizeof s2 = 22
>
>Naturally I didn't expect the "sizeofs" to be *identical* between the two
>programs (after all, one contains a struct within the class, and the other
>doesn't), however, I did expect them to be more nearly equal than that.  Can
>anybody explain this difference to me?  My curiosity is piqued.  Is it that
>the struct name isn't included within the class's memory allocation, or what?
>
>Peace,
>
>Doug

In your first example,
the nested class 'name' is in the scope of class s2 
but does not add to the size of s2.

For example every s2 object does not carry a name 
object. That is why sizeof s1 is 4. 

Sharma
-- 
The opinions expressed here are solely mine. My company has nothing
to do with these.

Email: sharma@euler.warren.mentorg.com
Newsgroups: comp.lang.c++