Path: utzoo!utgpu!jarvis.csri.toronto.edu!ists!yunexus!geac!alias!rae%alias@csri.utoronto.ca From: rae%alias@csri.utoronto.ca (Reid Ellis) Newsgroups: gnu.g++ Subject: named return value [was: Defining operators] Summary: ugly ugly Message-ID: <650@alias.UUCP> Date: 27 Nov 89 17:06:01 GMT References: <1253@cnetlu.UUCP> <8911221001.AA29853@lurch.Stanford.EDU> Sender: rae@alias.UUCP Reply-To: rae%alias@csri.utoronto.ca (Reid Ellis) Distribution: gnu Organization: Alias Research -- the cutting edge in JAGGIE technology Lines: 22 tiemann@lurch.stanford.edu writes: |Why not allow a fourth form, using Named Return Values (see |July/August C++ Report for details of this GNU C++ language |extension): | |matrix operator+(matrix& x, matrix& y) return z { ... } And look! It's extensible! Later we can add multiple return values! matrix operator+(matrix& x, matrix& y) return x,y,z { ... } Ya, dat's it.. :) But seriously, what if operator+ is used inside an expression in this new case? Then the compiler generates a temp on its own, I guess.. e.g.: A=(b+c)*2; Reid --- Reid Ellis, 264 Broadway Avenue, Toronto ON, M4P 1V9, Canada rae%alias@csri.utoronto.ca +1 416 487 1383 Brought to you by Super Global Mega Corp .com