From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,ac93bb8de02c38a8 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-08-24 22:51:23 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!headwall.stanford.edu!newshub.sdsu.edu!elnk-nf2-pas!newsfeed.earthlink.net!stamper.news.pas.earthlink.net!stamper.news.atl.earthlink.net!newsread2.news.atl.earthlink.net.POSTED!not-for-mail Sender: mheaney@MHEANEYX200 Newsgroups: comp.lang.ada Subject: Re: Overloading + operator References: <3F4981C5.BDF45D51@erols.com> From: Matthew Heaney Message-ID: X-Newsreader: Gnus v5.7/Emacs 20.7 Date: Mon, 25 Aug 2003 05:51:22 GMT NNTP-Posting-Host: 65.110.133.134 X-Complaints-To: abuse@earthlink.net X-Trace: newsread2.news.atl.earthlink.net 1061790682 65.110.133.134 (Mon, 25 Aug 2003 01:51:22 EDT) NNTP-Posting-Date: Mon, 25 Aug 2003 01:51:22 EDT Organization: EarthLink Inc. -- http://www.EarthLink.net Xref: archiver1.google.com comp.lang.ada:41835 Date: 2003-08-25T05:51:22+00:00 List-Id: Daniel Allex writes: > I have some Ada code that overloads the + operator. When I wrote the > code, I specified the left and write operand types. In C++ it seems > as though I can only overload the + operator in relation to a class. Yes, you can override the predefined "+" operation in Ada. > I have a structure that contains 3 elements. I want to add a value to > the structure. Do I need to create a class and the add a value to the > object? Why don't you just add it? Why can't you simply modify the code?