From -8111738915680709685
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: f78e5,9d57bb38940f08c2
X-Google-Attributes: gidf78e5,public
From: Biju Thomas <bijuthom@ibm.net>
Subject: Re: References to functions allowed?
Date: 1999/01/19
Message-ID: <36A3CA3A.C33862DF@ibm.net>#1/1
X-Deja-AN: 434221808
Content-Transfer-Encoding: 7bit
Approved: Fergus Henderson <fjh@cs.mu.oz.au>
References: <36A222B3.E51DFD28@ibm.net> <OxDGwfArQyo2EwCV@robinton.demon.co.uk> <xajr9ssr1qx.fsf@korrigan.inria.fr> <780f6f$kjs$1@engnews2.Eng.Sun.COM>
X-Original-Date: Mon, 18 Jan 1999 16:56:42 -0700
X-Notice: should be reported to postmaster@ibm.net
Content-Type: text/plain; charset=us-ascii
X-Complaints-To: news@news.unimelb.edu.au
X-Trace: izvestia.its.unimelb.edu.au 916707645 22148 128.250.29.16 (19 Jan 1999 01:00:45 GMT)
Organization: IBM.NET
X-Auth: PGPMoose V1.1 PGP comp.std.c++ iQBFAgUANqPZMOEDnX0m9pzZAQEtUAF9HYmTGv+uaPZ8W6McCgB72t6xdAVlJsls l2+fAyGTMrGMwJNhuYUXJW4/r3Uw+Edg =EpQP
Mime-Version: 1.0
Reply-To: bijuthom@ibm.net
NNTP-Posting-Date: 19 Jan 1999 01:00:45 GMT
Newsgroups: comp.std.c++

Steve Clamage wrote:
> 
> Sections 3.9.2 and 8.3.2 mention references to functions, and
> section 8.5.3 gives this example of a reference to function:
> 
>     int (&rg)(int) = g; // rg refers to the function g
> 

Okay, thanks.

What about references to members functions and references to member
data. Is the following legal?

struct Foo {
  int f ();
  int d;
};

int (Foo::&rmf)() = Foo::f;
int (Foo::&rmd)   = Foo::d;

Foo aFoo;

int x = (aFoo.rmf)();
int y = aFoo.rmd;

Looks like valid syntax. But, I am not sure.

-- 
Regards,
Biju Thomas
---
[ comp.std.c++ is moderated.  To submit articles, try just posting with ]
[ your news-reader.  If that fails, use mailto:std-c++@ncar.ucar.edu    ]
[              --- Please see the FAQ before posting. ---               ]
[ FAQ: http://reality.sgi.com/austern_mti/std-c++/faq.html              ]



