From -8654616810799457497
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: f78e5,b66186007131abfb
X-Google-Attributes: gidf78e5,public
X-Google-ArrivalTime: 1994-07-08 04:28:39 PST
Newsgroups: comp.std.c++
Path: bga.com!news.sprintlink.net!news.onramp.net!convex!cs.utexas.edu!howland.reston.ans.net!spool.mu.edu!sgiblab!news.cygnus.com!news!jason
From: jason@cygnus.com (Jason Merrill)
Subject: Re: References
In-Reply-To: Adrian@mcmen.demon.co.uk's message of Tue, 5 Jul 1994 20:44:41 +0000
Content-Type: text/plain; charset=US-ASCII
Message-ID: <JASON.94Jul8030623@deneb.cygnus.com>
Sender: news@cygnus.com
Nntp-Posting-Host: deneb.cygnus.com
Organization: Cygnus Support, Mountain View, CA
References: <773441081snz@mcmen.demon.co.uk>
Mime-Version: 1.0
Date: Fri, 8 Jul 1994 10:06:23 GMT
Lines: 10

>>>>> Adrian McMenamin <Adrian@mcmen.demon.co.uk> writes:

> Sorry if this is a FAQ but why is it not standard C++ to allow the
> initialisation of a referenceto type foo with a function that returns
> type foo?

Because doing so would involve binding a reference to a temporary object,
which is only allowed if the reference is to const foo.

Jason


