🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

1 total messages Started by Mark Grand Sat, 13 Apr 1991 19:47
handling of return values
#1015
Author: Mark Grand
Date: Sat, 13 Apr 1991 19:47
35 lines
1490 bytes
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
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads