(ref.doc)maxtal 010893

Next grumpy 010893 Prev: maxtal 250793 Up: Usenet

Newsgroups: comp.std.c++,comp.lang.c++
From: [email protected] (John Max Skaller)
Subject: Re: Reference to temporary?
Nntp-Posting-Host: physics.su.oz.au
Organization: School of Physics, University of Sydney, Australia
Date: Sun, 1 Aug 1993 19:40:56 GMT

In article <[email protected]> [email protected] (Scott Meyers) writes:
>In article <[email protected]> [email protected] (Brian Glendenning) writes:
>|                               I have just read that the Munich meeting
>| just clarified that the result of return by value is not an lvalue.
>
>Does this mean that the standard technique for differentiating between uses
>of operator[] as an lvalue and an rvalue by having it return a proxy object
>(which itself redefines operator=) can no longer be used?
>

	No, it doesnt mean that. It is an open issue and
currently being hotly debated whether non-values can bind
to non-const member functions.

	No matter what the resolution, it is reasonably
certain that a non-lvalue will continue to be able to be bound
to a *const* member function.

	So if you write the operator= for the proxy object
as const, you wont have any problem no matter what the
committee decides.

	If you want to have two proxies: const and non-const
ones, I advise that you use two classes:

	Proxy ...
	ConstProxy

which works even for global functions.

--
        JOHN (MAX) SKALLER,         INTERNET:[email protected]
	Maxtal Pty Ltd,		    CSERVE:10236.1703 
        6 MacKay St ASHFIELD,	    Mem: SA IT/9/22,SC22/WG21 
        NSW 2131, AUSTRALIA	    


automatically generated by info2www version 1.2.2.8