One more question.. :)
Consider again my example class, say I had:
class Class {
public:
static Class foo();
static const Class& constFoo();
and in foo:Quote:}
static Class
Class::foo
{
Class myvar;
...
return myvar;
Is this *legal*? Or would myvar also have to be declared static?Quote:}
I'm assuming it is *not* because wouldn't myvar be placed on the runtime
stack, and then when the function ends, all of its contents from the
runtime stack are deleted? Or is this a special case because foo
itself is static, so it will not necessarily run on the runtime stack?
And what about:
static const Class &
Class::constFoo() {
Class myconstvar;
...
return myconstvar;
Will I be able to return a pointer to a private variable of a staticQuote:}
class?
Tks,
Patrick
--
http://www.tendim.cjb.net/
Like anime? Got hotline?
hotline://twoaday.cjb.net/