🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

How do I... (regarding overloading)

#55
From: Brad S. Choate
Date: Tue, 21 Jul 1992 19:48
25 lines
1446 bytes
Ok... I'm new at this business, so this should be easy for some of the experts
out there.

I know about operator overloading and I can implement it to some degree without
consulting the manuals too much, but I'm stuck on this one:

    a[1]=x;

Ok.  "a" is an object that I have created and I've overloaded the [] operator
to allow me to return a value at position "1" (in this case) from my object.
However, in this case, I'm not needing output, I'm trying to _assign_ a value
to that position.  I know how to overload the "=" operator, but _how_ do you
do _both_ operators at the same time?

Perplexed++
(any ideas?)
e-mail me if you have an answer!  This one's been bugging me.
 - Brad
--
 Disclaimer: "I really don't care."

 |) |) /\ |\  | Brad S. Choate                      | 1314 E. Market, Apt. 6
 |) |\ || |/  |                                     | Searcy, AR  72143
 --------_--  | choate@acs.harding.edu              | (501) 279-2584
  <||()/\|[   | V.P., Software Extensions, Inc.
Technical Details
Message-ID: <1992Jul21.144856.583@ualr.edu>
Path: arc1-ca.pugleaf.net!sparky!uunet!zaphod.mps.ohio-state.edu!moe.ksu.ksu.edu!engr.uark.edu!mbox.ualr.edu!acs.harding.edu!CHOATE

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!sparky!uunet!zaphod.mps.ohio-state.edu!moe.ksu.ksu.edu!engr.uark.edu!mbox.ualr.edu!acs.harding.edu!CHOATE
Newsgroups: comp.std.c++
Subject: How do I... (regarding overloading)
Message-ID: <1992Jul21.144856.583@ualr.edu>
From: choate@acs.harding.edu (Brad S. Choate)
Date: 21 Jul 92 14:48:55 -0500
Reply-To: choate@acs.harding.edu
Organization: Harding University
Nntp-Posting-Host: acs.harding.edu
Lines: 25