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.4 required=5.0 tests=BAYES_00,FORGED_GMAIL_RCVD, FORGED_MUA_MOZILLA,FREEMAIL_FROM autolearn=no 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.68.197.201 with SMTP id iw9mr3115702pbc.6.1353344549021; Mon, 19 Nov 2012 09:02:29 -0800 (PST) Path: s9ni25506pbb.0!nntp.google.com!Xl.tags.giganews.com!border1.nntp.dca.giganews.com!nntp.giganews.com!local2.nntp.dca.giganews.com!news.giganews.com.POSTED!not-for-mail NNTP-Posting-Date: Mon, 19 Nov 2012 11:02:28 -0600 Date: Mon, 19 Nov 2012 12:02:27 -0500 From: "Peter C. Chapin" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:16.0) Gecko/20121028 Thunderbird/16.0.2 MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: Access type to member procedure of instance (Object Oriented programming in Ada) References: <9b0bcb37-8ae3-440f-af4f-a796702e4250@googlegroups.com> <49cdda31-d0bd-42f2-8076-65504105d07e@googlegroups.com> In-Reply-To: <49cdda31-d0bd-42f2-8076-65504105d07e@googlegroups.com> Message-ID: X-Usenet-Provider: http://www.giganews.com X-Trace: sv3-PhzWGENlbObNW1a/CauQIQVOwdnpo64qe9XEc74mQ7ixP6km/wqj2dWDlNis/4kOZFRovxQvvCm0jCn!hxyK9tyYDXqH1zUB1+Vucre94xggpjKMQCEorA2i7M+sXhi5ht+ZwF7CDVvT9gE= X-Complaints-To: abuse@giganews.com X-DMCA-Notifications: http://www.giganews.com/info/dmca.html X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.3.40 X-Original-Bytes: 1997 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Date: 2012-11-19T12:02:27-05:00 List-Id: On 11/19/2012 11:18 AM, Adam Beneschan wrote: > No, I don't think so. I've been thinking about proposing an addition > to Ada to do something like this, since I think this feature does > exist in other languages (C# delegates, in particular; I don't know > C++ well enough to know whether there's something similar there). FWIW C++ does have a "pointer to member" feature. It looks like this class Example { public: void f( int ); }; // Declare p to be "pointer to member function of Example... // Initialize p to point at Example::f. void (Example::*p)( int ) = &Example::f; Example object; // Create an object. object.*p(42); // Invoke member f indirectly on 'object' Peter