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-Thread: 103376,cab230a084a14384 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news4.google.com!newshub.sdsu.edu!elnk-nf2-pas!newsfeed.earthlink.net!stamper.news.pas.earthlink.net!newsread2.news.pas.earthlink.net.POSTED!a6202946!not-for-mail From: Jeffrey Carter Organization: jrcarter commercial-at acm [period | full stop] org User-Agent: Mozilla Thunderbird 1.0.2 (Windows/20050317) X-Accept-Language: en-us, en MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: ++ of C in ada References: <1122228917.377279.262690@g47g2000cwa.googlegroups.com> In-Reply-To: <1122228917.377279.262690@g47g2000cwa.googlegroups.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Message-ID: Date: Mon, 25 Jul 2005 05:55:23 GMT NNTP-Posting-Host: 4.240.69.80 X-Complaints-To: abuse@earthlink.net X-Trace: newsread2.news.pas.earthlink.net 1122270923 4.240.69.80 (Sun, 24 Jul 2005 22:55:23 PDT) NNTP-Posting-Date: Sun, 24 Jul 2005 22:55:23 PDT Xref: g2news1.google.com comp.lang.ada:3745 Date: 2005-07-25T05:55:23+00:00 List-Id: nicolas.b wrote: > How can i implement the operator ++ in ada : > > type T_Ptr is access all T_Item; > How can i implement : procedure Increment (Ptr : in out T_Ptr); The fact that you're asking this indicates that you're at a stage in your exposure to Ada when you will probably have no need whatsoever for access types. Access types are rarely needed in Ada unless you're creating a dynamic data structure, and even then you don't need pointer arithmetic. If you have some problem for which you think access types and pointer arithmetic are required, let us know what the problem is and I suspect we can show you why you're wrong, and what the Ada way is. In the extremely rare case that you're not wrong, we can show you what to do. -- Jeff Carter "C++: The power, elegance and simplicity of a hand grenade." Ole-Hjalmar Kristensen 90