Re: delete this; return ret;
> In other words, will //LABELED line
> be executed? My confusion is that the
> object should have been destructed at
> that time.
Yes it will. You can't access any member variables after delete this, but it
doesn't affect the execution of the code. The only requirement of course is
that your object is on the heap (constructed with new), not on the stack.
In fact, when implementing a Microsoft COM component, it's the most common
way of implementing IUnkown::Release():
if( m_nRef == 0 )
return 0; // can't access m_nRef anymore
"Not only do I not know the answer
I don't even know what the question is"
My world - Metallica
|All times are GMT. The time now is 02:04 AM.|
Powered by vBulletin®. Copyright ©2000 - 2013, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.