raii

Ellery Newcomer ellery-newcomer at utulsa.edu
Sun Feb 28 15:16:42 PST 2010


On 02/28/2010 02:16 PM, Ellery Newcomer wrote:
> RAII!(Foo) foo(int i){
> return RAII!(Foo)(new Foo(i));
> }

One thing I'm curious about in particular is how to ensure that the 
destructor of Foo doesn't get called inside foo.

With this particular code, it evidently doesn't, but I can't tell if 
it's a guarantee of the language, or a side effect of some optimization.


More information about the Digitalmars-d-learn mailing list