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.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,5394d9ca5f955366 X-Google-Attributes: gid103376,public From: Matthew Heaney Subject: Re: pointers & OOP Date: 1999/05/01 Message-ID: #1/1 X-Deja-AN: 472998107 References: NNTP-Posting-Date: Sat, 01 May 1999 14:57:23 PDT Newsgroups: comp.lang.ada Date: 1999-05-01T00:00:00+00:00 List-Id: Matthew Heaney writes: > John Robinson writes: > > > Any collection class for example will need to use pointers, even if > > the collection is based around a fixed length array. > > Yes, a collection whose items have a class-wide type will require > pointer use. But you can use a smart pointer, so you don't have to > worry about any pointer manipulation headaches. Gives you the same as a > reference in other OO languages. I should also have mentioned that when you declare the primitive operations of the type to take access parameters, this effectively hides the fact that you manipulating a pointer. The syntax of method invokation is the same as for a non-pointer. > For some ideas on smart pointers, how to control instance creation, etc, > peruse the articles (mostly Oct/Nov 98 to the present) in the Ada95 > design patterns archive at the ACM. > > The ACM patterns archives also has lots of examples of the access parameter technique. Matt