HDTenEightyP/NetNews huggingface dataset:
From: steve@taumet.com (Steve Clamage)
Subject: Re: Answers on a postcard...
Organization: TauMetric Corporation
Date: Fri, 11 Sep 1992 17:47:16 GMT

Karl Keyte <KKEYTE@ESOC.BITNET> writes:

>>In the expression in parens, it is unspecified whether "x=1" or
>>"x+1" is evaluated first.  They are arguments to the "operator,()"
>>function, not the left and right side of a comma-expression.  If
>>"x+1" is evaluated first, which is legal, it will use an
>>uninitialized "x.value".

>The implication of what you say is that it is not possible to overload
>operators maintaining the correct functionality of the operator.  This
>indeed means that precedence in overloaded operators cannot be maintained
>if all operands are simply passed as arguments to the function implementing
>the operator functionality and evaluated in a language independent order.
>Imagine commonly used "chain" operators such as && and .

First, precedence and order of evaluation are different concepts.
In the expression
	a + b * c
(where a, b, and c may themselves be parenthesized expressions)
fixed precedence means the expression is always equivalent to
	a + (b * c)
independent of operator overloading.  Overloading does not change
precedence.  You still do not know which of 'a', 'b', and 'c' is
evaluated first and which is evaluated last.  You also do not
know whether 'a' is evaluated before or after the '*' operation
is performed.  Within the limits of precedence, the order of
evaluation is unspecified.  Precedence does require that '*'
be performed before '+', since '+' requires the result of '*'.

Second, what is the "correct" functionality of an overloaded operator?
The language imposes no restrictions on the semantics of overloaded
operators (except for ->).  You could define "&&" to do literally
anything; it need not be any sort of logical "and".

The non-overloaded && and || enforce an order of evaluation because
their value can be potentially be known without evaluating the
second operand.  The conditional evaluation makes for compact
expressions.  An overloaded operator && or || cannot be assumed
to have such behavior, and both operands must always be evaluated.

The only other overloadable operator which imposes order of evaluation
is the comma.  Originally it was not overloadable, since there seemed
to be no good reason to allow it.  It looks like we have found a
good reason to disallow it, namely that the implied order of
evaluation no longer holds.  (Too bad it is so hard to stuff the
genie back into the bottle.)
-- 

Steve Clamage, TauMetric Corp, steve@taumet.com
Vice Chair, ANSI C++ Committee, X3J16
From: jxd7299@hertz.njit.edu (Jing X Ding)
Newsgroups: comp.lang.c++
Subject: help
Date: 13 Sep 92 16:40:46 GMT
Organization: New Jersey Institute of Technology, Newark, N.J.


	PROD *A;//PROD is a defined class
	   :
	   :
	for (...){
	A=(PROD*)new char [totalprod*sizeof(PROD)];//totalprod is a const
	   :
	   :
	 Place 1
	}
	 Place 2

The problem is :(1) Where can I use destructure to free memory (Place 1 or
Place 2)? (2) How to write the destructure?

Thank you so much!


Jing Ding(jxd7299@hertz.njit.edu)
Xref: sparky comp.lang.c++:13368 comp.object:3466
From: shu@rascal.UUCP (Shu)
Newsgroups: comp.lang.c++,comp.object
Subject: WANTED: SQL wrapper in _any_ OOL!
Keywords: SQL, Object Oriented programming languages, OO wrappers, C++
Date: 7 Sep 92 14:12:22 GMT
Followup-To: poster
Organization: Rascal Systems


Hi!
I posted this some time ago, but there was no answer :-(
So, here is the re-post (slightly modified):

  We are currently developing an application (in C++) that needs to use data
  base services. We decided to design a class that implements essentially
  the standard SQL capabilities.

  Does anyone know anything about such classes already existing in any OO
  language?

  We are interested in report writing as well.

  Thank you for _any_ ideas and references.

Please e-mail, I'll summarize (if I receive any answers, eh :-)

Cheers!
Shu

+-------------------------------------------------------------------------+
| shu@rascal.UUCP                                                         |
+-------------------------------------------------------------------------+
Newsgroups: comp.lang.c++
From: 870086t@dragon.acadiau.ca (Shannon Tremblay)
Subject: Borland's IDE and resource workshop
Organization: Acadia University
Date: Thu, 10 Sep 1992 23:37:38 GMT


Hi all,

I have been working with the Resource Workshop that comes with the Borland
C++ package.

My problem is that even when i list the *.RC file in my project and try
'MAKE' from the menu it tells me it is looking for the *.RES file not
the *.RC file.  Even though i tell it to use the *.RC file.

Has anyone else had this probem and if so how did you fix it.

I currently have to enter MS Windows to run Workshop in order to create
the *.RES file in order to be able to compile my code.

Thanks in Advance.

Shannon Tremblay
870086t@acadiau.ca
Acadia University
From: John Werner <werner@soe.berkeley.edu>
Newsgroups: comp.lang.c++
Subject: Re: XVT second try.
Date: 9 Sep 1992 18:58:10 GMT
Organization: UC Berkeley School of Education
Distribution: world
NNTP-Posting-Host: tol7mac19.soe.berkeley.edu
X-UserAgent: Nuntius v1.1

[Why was this question posted in comp.lang.c++ anyway?]

At my last job (at SPSS Inc.) I was involved in a research project
evaluating future cross-platform projects.  We spent most of our
time evaluating and prototyping with XVT.  One of SPSS's current
products (SPSS for Windows) is also mostly written with XVT.  So I
can give you some opinions.

For totally-from-scratch portable development, XVT probably isn't so
bad.  Code that's written using just the XVT api is indeed portable.
 The catch is that the API is basically a lowest common denominator
of all the machines it supports.  The people at XVT will deny this;
it's sort of a religious issue with them.  But just try to get them
to support some functionality that isn't directly supported by all
the machines, and you'll find out the truth.  We were trying to get
them to support floating windows and pop-up menus, among other
things, and they refused, basically for religious reasons.

What little I saw of XVTs C++ class library made me want to run and
hide.   It was just a set of wrapper classes around the various
objects in the C api.  I spent a fair amount of time writing a
MacApp-inspired C++ library around XVT.  It's possible to do, and it
was actually kind of fun for me, but it's something XVT should have
done themselves.  I think writing a real class library is definitely
the way to go if you plan to write a large user interface with XVT.

And finally, the programmers who developed SPSS for Windows using
XVT absolutely HATED it.  Part of this was related to dialog box
support: XVT doesn't allow you to define custom controls in dialogs
at all portably.  Related to this is the fact that mixing
non-portable code into an XVT application is a major nightmare; you
start running into lots of "who's in charge" issues.

Summary: If you're writing a simple program, without complicated
dialogs, or if you're willing to take the time to write a large
class library around XVT, it might be worth using.
Otherwise don't.

PS: Have you considered writing in MacApp and then porting to
Bedrock (the new portable class library being developed by Apple and
Symantec) when it comes out (early next year?)?
 
--
John Werner                         werner@soe.berkeley.edu
UC Berkeley School of Education     510-642-9651
From: kps@cunixb.cc.columbia.edu (Karthik P Sheka)
Newsgroups: comp.lang.c++
Subject: pointer typecasting question...
Date: 10 Sep 92 21:03:19 GMT
Reply-To: kps@cunixb.cc.columbia.edu (Karthik P Sheka)
Organization: Columbia University


I'm working on a C++ program that is using a C package that is giving
problems (The package was not meant to be used in C++):

One C call I make, CreateButton, takes as an arguement, a pointer to a
function that takes one arguement and returns void:

void function(int arguement);
main()
{
	CreateButton(function);
}

When used in a C++ program, I want to send a pointer to an instance of a
public function.  Unfortunately, this does not work:

class func1{
  public:
    function(int arguement);
};

func1 *instance;

main()
{
  instance = new func1
  CreateButton(func1->function);
}


What does work is(This is not usable by my program, because it does not
call an instance of the class):

class func1{
  public:
    function(int arguement);
};

main()
{
  void (*called_function)(int) = (void (*)(int))func1::function;

  CreateButton(called_function);
}


My question is, "How can I send a pointer to an instance of a function?"
  (I tried
    void (*called_function)(int) = (void (*)(int))instance->function; 
  but that doesn't work.)

//Karthik Sheka
From: wayne@concave.cs.wits.ac.za (Wayne Smith)
Subject: Parametrized Constructors
Organization: Wits Univ. Computer Science Dept.
Date: Tue, 8 Sep 1992 13:30:59 GMT

Hi,

I hope I not asking a simple question, but I would like to know the following:

I am using AT&T's c++ translator. I am trying to declare a pointer to a class that has a parametrized constructor as a member. e.g

class foo
   {
    ...
    ...
public:
    foo(int s);
    ...
   };

when I declare:

foo *fooptr;

I get a translator message saying an integer parameter is expected. I tried adding a parameterless contructor to the class definition but it still complains. Another thing I am trying to do is declare an array of objects that take parametrized constructors e.g:

fooarray = new foo(2)[10];

apparantly this is not possible in c++, but  I need a conceptually decent workaround.

Does anyone have any solutions. Information would be much appreciated. Please reply to my email address. I will summarize and post.

Cheers,
Wayne*********************************************************************
* Wayne Smith                         (wayne@concave.cs.wits.ac.za) *   
* University of the Witwatersrand      Phone (011) 716-3295         * 
* Computer Sciece Department                                        *
* P.O Box WITS                                                      *
* Johannesburg                                                      *
* 2050                                                              *
* South Africa                                                      *
*********************************************************************
From: barmar@think.com (Barry Margolin)
Newsgroups: comp.lang.c++
Subject: Re: Proposal: Subscripting with multiple arguments
Date: 15 Sep 92 16:43:49 GMT
Organization: Thinking Machines Corporation, Cambridge MA, USA
NNTP-Posting-Host: telecaster.think.com

In article <MATT.92Sep14221904@physics2.berkeley.edu> matt@physics.berkeley.edu writes:
>Note, by the way, that if you're overloading operator(), there's no
>way around this, since the signature of that function is different
>depending on the dimensionality of the array.  That is,
>two-dimensional arrays work by overloading operator()(int,int), but
>three-dimensional arrays work by overloading operator()(int,int,int).
>You can't overload an infinite number of functions, so there has to be
>some maximium on the dimensionality that you support.

Can you overload operator()(int,...)?  I looked in the ARM quickly and
couldn't see a prohibition of this in the section about overloading
operator().

Of course, this type of function is not type-safe.  The implementation of
it would probably have to assume that the number of arguments is at least
the number of dimensions of the array being indexed.

-- 
Barry Margolin
System Manager, Thinking Machines Corp.

barmar@think.com          {uunet,harvard}!think!barmar
Newsgroups: comp.lang.c++
From: J.March@lut.ac.uk
Subject: Novice question
Reply-To: J.March@lut.ac.uk (Jon March)
Organization: Loughborough University, UK.
Date: Sat, 5 Sep 92 00:09:38 GMT

Why dosn't this work?...

class thing 
{
	...
	void	f();
	void	g();
}

void main()
{
	thing obj;

	obj.f().g();
}



I am trying to get this sort of effect:

	obj <- g( f( obj ) )


Jon March
From: ashutosh@engr.latech.edu (Ashutosh Srivastava)
Newsgroups: comp.lang.c++
Subject: Try
Date: 7 Sep 92 22:07:38 GMT
Reply-To: ashutosh@engr.latech.edu
Organization: Louisiana Tech University

Just Trying .....
Newsgroups: comp.lang.c++
From: sdm@cs.brown.edu (Scott Meyers)
Subject: inline virtual functions
Organization: Brown University Department of Computer Science
Date: Tue, 15 Sep 1992 02:33:36 GMT

For all the compilers with which I am familiar, inline virtual functions
are oxymoronic:  the function bodies are never inlined, and the object file
for each translation unit seeing the definition of the function receives a
static copy of the function.  I tested this using cfront 3.0 and g++ 2.2.2,
and both behaved as I have described, neither issuing a warning about not
inlining a function.

Many people have discovered this behavior in current compilers, and so the
following rule is widely followed: "never define an inline virtual
function."  This is a pity, because it's the kind of rule that is easy to
remember, hence people will continue to follow it even when C++ compilers
become agressive enough in their optimization to be able to generate
inlined calls to virtual functions.

I was involved in a discussion of this issue today when it was suggested
that compilers should generate only a single copy of an out-of-line virtual
function, and that the single translation unit in which the function
definition should be generated should be the same as the one containing the
class's vtbl.  This seems sensible to me, so I was wondering: is there some
reason why compiler implementers don't do this?

Thanks,

Scott


-------------------------------------------------------------------------------
What do you say to a convicted felon in Providence?  "Hello, Mr. Mayor."
From: scottm@intime.intime.com (Scott Michel)
Newsgroups: comp.lang.c++
Subject: Re: zero-length datatype
Date: 15 Sep 92 18:58:54 GMT
Distribution: comp
Organization: -- J/24 -- Racers Home for Programmers

In article <1992Sep14.152627.6690@cadsun.corp.mot.com> shang@corp.mot.com (David (Lujun) Shang) writes:

   Newsgroups: comp.lang.c++
From: ark@alice.att.com (Andrew Koenig)
Newsgroups: comp.lang.c++
Subject: Re: zero-length datatype
Date: 12 Sep 92 15:54:04 GMT
Reply-To: ark@alice.UUCP ()
Distribution: comp
Organization: AT&T Bell Laboratories, Murray Hill NJ

In article <1992Sep11.185505.17536@cadsun.corp.mot.com> shang@corp.mot.com writes:

> That is why ISO C standard does not allow empty structure and zero 
> number of array.

No, ISO C does allow empty structures.  It just says that they must
occupy a non-zero amount of memory.

> But I don't see the reason why we can't have zero-size objects. Don't 
> say that the standard explicitly says that. I want to know why it says 
> that. So far, I haven't heard any convincing argument.

I don't really know why.  What I do know is that the presence of that requirement
in the C standard makes it hard to avoid the same requirement in the C++ standard.
-- 
				--Andrew Koenig
				  ark@europa.att.com
From: rose@t524i5.telematik.informatik.uni-karlsruhe.de (Ortwin Rose)
Newsgroups: comp.lang.c++
Subject: Re: More on C++ yacc grammar
Date: 14 Sep 92 07:53:10
Organization: /usr/users/rose/.organization
NNTP-Posting-Host: t524i5.telematik.informatik.uni-karlsruhe.de
In-reply-to: johnrp@well.sf.ca.us's message of Sun, 13 Sep 1992 01:58:45 GMT


Did you try

   ftp.th-darmstadt.de: /pub/programming/languages/C++/tools/c++grammar2.0.tar.Z
  (130.83.55.75)

Think this might be the grammar you are looking for.

Regards

-- O. Rose
   University of Karlsruhe
   Institute of Telematics
   Karlsruhe
   Germany
Newsgroups: comp.lang.c++
From: steve@taumet.com (Steve Clamage)
Subject: Re: I/O streams in ANSI definition?
Organization: TauMetric Corporation
Date: Wed, 9 Sep 1992 16:36:29 GMT

d9patrik@dtek.chalmers.se (Patrik Larking) writes:

>I have a few questions about to the c++ I/O streams.

>Are they included in the ANSI definition of the c++ language?

They will (almost certainly) be part of the Standard when it is complete.

>Are they a part of the 3.0 definition or is there a separate definition?

Most, if not all, modern C++ implementations include some version of
iostreams.

>Are binary files included (ios::binary)?

It depends on the particular version of iostreams.  Current versions
of iostreams for Unix usually do not support "binary" (because there
is no difference in Unix between text and binary files).  In the future,
probably all versions will support a "binary" flag, although the
spelling is not certain.  (It might be "ios::bin".)

>I currently own the C++ Primer by Lippman and The Annotaded reference manual.
>Neither of theese treat the I/O stream fully and I don`t want to bye a complte
>new book! 
> Are there any seperate publications witch only treat the I/O library.

You can order the C++ library manual from AT&T (or maybe USL) which
describes the original AT&T implementaion of iostreams in detail.
You will have to get ordering information from someone else.

>Can I require the ANSI documents direct whole c++ definition or partly (I/O 
>library only)?

The ANSI/ISO C++ committee has not completed work on the iostream
definition.  When complete, it will specify a minimum functionality
which all Standard implementations will have to provide.  It will
not be ideal as a reference, except for knowing what you can depend
on for a maximally portable program (among Standard implementations).
You will still want complete documentation from your compiler vendor,
because many details will be left up to the implementation.
-- 

Steve Clamage, TauMetric Corp, steve@taumet.com
Vice Chair, ANSI C++ Committee, X3J16
From: fellin@sumax.seattleu.edu (Phillip Fellin)
Newsgroups: comp.lang.c++
Subject: XVT Portability Kit
Keywords: XVT
Date: 5 Sep 92 23:04:49 GMT
Organization: Seattle University, Seattle, WA



From: Paul.Farrand@f851.n800.z3.fidonet.org (Paul Farrand)
Sender: acsnet@csource.oz.au
Newsgroups: comp.lang.c++
Subject: Did I just shoot myself
Date: Wed, 02 Sep 1992 21:15:00 +1000

 On 08-31-92 David Wilson wrote... 
 
 DW> I just ordered Borland C++ with Application Framework from a mail order 
 DW> house.  Did I shoot myself in the foot? 
 DW>  
 DW> Here's the problem:  I have a 286 with 1 meg of memory.  A review in the 
 DW> last issue of PC Magazine indicated a meg of extended memory is also
required. 
 DW> I called Borland, and was told the compiler would run on my machine.  With

 DW> that confirmation, I went ahead and ordered.  I only want to run under DOS,

 DW> developing for DOS with TurboVision, for the time being.  Am I going to be

 DW> able to, or am I going to have to shell out for extended memory?? 
 
 BANG! 
 
David, 
      Yeah sorry, if you have ordered 3.1 + App-Frame's then you'll need 640K 
      PLUS 1 Meg of extended memory.  Come on ... do yourself a favour and lash

      out and by yourself a 386! 
 
Cheers, 
       Paul 
 
... OFFLINE 1.32 * To Err is Human, to really stuff things up takes a computer!


 * Origin: Biz-Nice! South Oz Business BBS! 4 Lines (08)269 7029/7809
(3:800/851)

Newsgroups: comp.lang.c++
From: twillis@nrao.edu (Tony Willis,,,)
Subject: Re: Exponentiation operator proposal
Reply-To: twillis@nrao.edu
Organization: National Radio Astronomy Observatory
Date: Tue, 15 Sep 92 15:09:06 GMT


As a long time FORTRAN programmer, I would certainly welcome an
exponentiation operator. However, given the many ways ** can already
interpreted in c++,  I support the suggestion that something like *^
or ^^ should be used.
From: johns@trident.datasys.swri.edu (Stephen Johns)
Newsgroups: comp.lang.c++
Subject: Re: ObjectCenter and MWM
Keywords: ObjectCenter and MWM
Date: 8 Sep 92 18:56:39 GMT
Organization: Southwest Research Institute, San Antonio

In article <128@io.trident.datasys.swri.edu> johns@trident.datasys.swri.edu (Stephen Johns) writes:
>Admittedly somewhat of an off base question, but...
>
>Does anyone have ObjectCenter working on a SPARC station running MWM as
>their window manager?  ObjectCenter runs under MWM, but I am unable to
>move, resize or change the stacking order of the windows.  Everything
>is fine under OLWM.
>-- 
>Stephen Johns, Research Analyst
>Southwest Research Institute, SA, TX 78228 (512) 522-5751

My apologies.  It works fine as long as you use the MIT R5 server.
-- 
Stephen Johns, Research Analyst
Southwest Research Institute, SA, TX 78228 (512) 522-5751
From: ryoung@utdallas.edu (Ryu Young)
Newsgroups: comp.lang.c++
Subject: Which Boland/Turbo C++???
Date: 11 Sep 92 21:34:45 GMT
Organization: Univ. of Texas at Dallas

Sorry if it was discussed previously. I am a new subscriber
of this new group.

Recently, I am trying to purchase C/C++ for MS Windows.
It seems there are several products available; but
I decided to buy Boland's product. Still there are options:

	Turbo C++ for Windows			$61.35
	Boland C++ for Windows (& DOS)		$101.35
	Boland C++ & Application Frameworks	$201.35
	(Note: prices are for educational institutions.)

Please instruct me what each of the above can/can't do?
(Esp. what is Application Frameworks?)

Young
(ryoung@utdallas.edu)
Newsgroups: comp.lang.c++
From: cflatter@nrao.edu (Chris Flatters)
Subject: Re: Exponentiation operator proposal
Reply-To: cflatter@nrao.edu
Organization: NRAO
Date: Tue, 15 Sep 1992 15:56:54 GMT

In article 4126@cc.tut.fi, jk87377@cc.tut.fi (Juhana Kouhia) writes:
>Instead of making exponential operator; I would like to get
>a new basic operation which allows programmer to define new
>operations like 'a ** b'; that is, the '**' is defined.
>('a pow b' is also good.)

Allowing the introduction of new operators on the fly is a nasty problem.
Firstly, adding an operator means introducing a new lexeme which requires
changing the lexical analyser on the fly.  Secondly, the syntax analyser
needs to be modified on the fly to be able to parse expressions involving
the new operator.  Neither of these are particularly easy to do.

	Chris Flatters
	cflatter@nrao.edu
From: matt@physics2.berkeley.edu (Matt Austern)
Newsgroups: comp.lang.c++
Subject: Re: Numerical Recipes in C++?
Date: 8 Sep 92 18:17:08 GMT
	<xeno.713564280@pv6f05.vincent.iastate.edu>
	<l9ba7lINN3re@almaak.usc.edu> <1992Sep1.124716.29134@eua.ericsson.se>
Reply-To: matt@physics.berkeley.edu
Organization: Lawrence Berkeley Laboratory (Theoretical Physics Group)
NNTP-Posting-Host: physics2.berkeley.edu
In-reply-to: euamts@eua.ericsson.se's message of 1 Sep 92 12:47:16 GMT

In article <1992Sep1.124716.29134@eua.ericsson.se> euamts@eua.ericsson.se (Mats Henricson) writes:

> >NR in C++ is due within a few months.
> 
> This pisses me off considerbly!! I had my local computer bookstore
> call Cambridge University Press to ask them if they had a C++ version
> coming up, and they replied NO. So, I bought the C-version. Now I have
> to put up even more cash when the new version comes, and I tell you,
> the book isn't cheap...

The real question: will _Numerical Recipes in C++_ really be in C++,
or just in C with a few extras?  That is: will it really be a book
about object-oriented numerical programming?

My guess is that it won't be.  If you look at the "C" code in
_Numerical Recipes in C_, its FORTRAN origins are very obvious; the
essential style of the code was unchanged.  I doubt that the authors
will really want to do the massive redesign job of making all of their
code oriented.  I would guess that they will use inline functions
instead of macros for square() and cube(), and that they will use
matrix and complex number classes instead of the constructs they
presently have, and that will be just about that.

In other words: if you have a C++ compiler, all of the code in
_Numerical Recipes in C_ will work.  I doubt if you can expect much
more than that from _Numerical Recipes in C++_.
--
Matthew Austern                   Just keep yelling until you attract a
(510) 644-2618                    crowd, then a constituency, a movement, a
austern@lbl.bitnet                faction, an army!  If you don't have any
matt@physics.berkeley.edu         solutions, become a part of the problem!
Newsgroups: comp.lang.c++