Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!mips!cs.uoregon.edu!ogicse!ucsd!pacbell.com!pacbell!premenos!premenos!mark From: mark@premenos.premenos.COM (Mark Grand) Newsgroups: comp.std.c++ Subject: handling of return values Message-ID: Date: 13 Apr 91 19:47:03 GMT Sender: mark@premenos.uucp (Mark Grand) Distribution: comp Organization: Premenos Lines: 35 My understanding of the semantic of the return statement is that the expression following return is evalated, a copy of the value is created using the appropriate copy constructor and the copy is returned. My question involves the circumstance extern MyObj foo(); ... foo(); What becomes of the return value? Borland C++ waits until it reaches the end of the scope enclosing the call to foo() before calling the destructor for its return value. If a destructor is to be called then when. In a case such as extern MyObj foo(); ... loop: foo(); ... goto loop; will a destructor be called for every value returned by foo()? -- ======== Mark Grand Premenos Corporation 415-602-2073 1000 Burnett Avenue, Suite 200 Concord, CA 94520 ...!attmail!premenos ...!{sun, ames, att}!pacbell!premenos!mark -- ======== Mark Grand Premenos Corporation 415-602-2073