On Feb 21, 10:09 pm, Ian Collins <ian-n...@hotmail.com> wrote:
> On 02/22/11 03:54 AM, Stuart Redmann wrote:
>
> > On 21 Feb., "Paul" wrote:
> >> What is your idea of the lifetime of a function?
> >> a) from function calling code until return?
> >> b) from start of program until end of a program?
> >> c) something other?
>
> > I'd opt for b).
>
> Considering this is purely a metaphysical discussion, c) is an equally
> plausible description. On this box, a standard library function like
> puts() has existed for the 47 days, 17 hours and a few minutes, since
> the system booted and loaded libC into memory.
>
I don't see the source of the confusion here. This is very simple.
A member function's lifetime spans from the completion of its
constructor to the beginning of its destructor.
A static member function doesn't ever have a lifetime because it
doesn't have any constructors - with the exception of virtual static
member fucntions who can't have a constructor themselves, but can
inherit one from their superfunction.
* BTW my definition of "virtual static member function" is a static
member function that only has a virtual lifetime because it's inherits
it superfunction in virtual inheritance.
As has been mentioned by the creators of the language. See relevant
quotes I have given in some of my posts on this newsgroup and some
others, and in some email I sent to my ex-girlfriend Shira.
Also you should probably check this:
http://www.youtube.com/watch?v=sc3nIoiOUEk
itaj