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,26a21b9e317dc639 X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Received: by 10.66.72.134 with SMTP id d6mr2939250pav.20.1353349393649; Mon, 19 Nov 2012 10:23:13 -0800 (PST) Received: by 10.50.37.232 with SMTP id b8mr2878653igk.4.1353349393466; Mon, 19 Nov 2012 10:23:13 -0800 (PST) Path: 6ni93808pbd.1!nntp.google.com!kt20no2717097pbb.1!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Mon, 19 Nov 2012 10:23:13 -0800 (PST) In-Reply-To: Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=66.126.103.122; posting-account=duW0ogkAAABjRdnxgLGXDfna0Gc6XqmQ NNTP-Posting-Host: 66.126.103.122 References: <9b0bcb37-8ae3-440f-af4f-a796702e4250@googlegroups.com> <49cdda31-d0bd-42f2-8076-65504105d07e@googlegroups.com> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <2d141696-2cd2-4805-8c51-cf6620abc9ce@googlegroups.com> Subject: Re: Access type to member procedure of instance (Object Oriented programming in Ada) From: Adam Beneschan Injection-Date: Mon, 19 Nov 2012 18:23:13 +0000 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Date: 2012-11-19T10:23:13-08:00 List-Id: On Monday, November 19, 2012 9:02:29 AM UTC-8, Peter C. Chapin wrote: > On 11/19/2012 11:18 AM, Adam Beneschan wrote: >=20 >=20 > FWIW C++ does have a "pointer to member" feature. It looks like this >=20 > class Example { >=20 > public: >=20 > void f( int ); >=20 > }; >=20 > // Declare p to be "pointer to member function of Example... > // Initialize p to point at Example::f. > void (Example::*p)( int ) =3D &Example::f; >=20 > Example object; // Create an object. > object.*p(42); // Invoke member f indirectly on 'object' This doesn't look at all like what I'm talking about, since &Example::f sti= ll refers to a method defined for the class Example but without reference t= o a particular object. Something equivalent would be if you could say &obj= ect.f (or maybe &object.*p) and store the result of that in a pointer that = could be called later. -- Adam