🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.std.c++
Article #165

Re: Exponentiation operator proposal

#165
From: Hallvard B Furuseth
Date: Mon, 14 Sep 1992 19:53
22 lines
1549 bytes
Sorry, I just cancelled an article where a rather essential part was
deleted (I just intended to move it...)  Here is next attempt -

In article <23660@alice.att.com> bs@alice.att.com (Bjarne Stroustrup) writes:

> (2) I think we could actually get ** as the exponentiation operator.
> (...)
>	   All we need to do is to say that the exponentiation
>	   operator ** given a first operand `a' of arithmetic type
>	   and a second operand `b' of pointer type (that is, `a**b')
>	   mean multiply the first operand with the dereference value
>	   of the second operand (that is, `a*(*b)').

The few times I use a**b, a and *b are usually class objects.  operator*
could be cross product or a set operation.  b.operator*() may exist too,
but to me that is less important.  To allow both this and Complex
operator**(Complex&,Complex&), I think the rule must be something like
"** is exponentiation unless that is an error".  I do not volunteer to
write the parser though.  A binary operator~ is my favorite.
--

Hallvard
Technical Details
Message-ID: <HBF.92Sep14205333@durin.uio.no>
Path: arc1-ca.pugleaf.net!sparky!uunet!mcsun!sunic!aun.uninett.no!nuug!nntp.uio.no!hbf
References: <23660@alice.att.com>

Show Full Headers
Complete Article Headers
Newsgroups: comp.std.c++,comp.lang.c++
Path: arc1-ca.pugleaf.net!sparky!uunet!mcsun!sunic!aun.uninett.no!nuug!nntp.uio.no!hbf
From: hbf@durin.uio.no (Hallvard B Furuseth)
Subject: Re: Exponentiation operator proposal
In-Reply-To: bs@alice.att.com's message of 12 Sep 92 18:30:53 GMT
Message-ID: <HBF.92Sep14205333@durin.uio.no>
Sender: news@ulrik.uio.no (Mr News)
Nntp-Posting-Host: durin.uio.no
Organization: University of Oslo, Norway
References: <23660@alice.att.com>
Date: Mon, 14 Sep 1992 19:53:33 GMT
Lines: 22