diff -r ebc84c812384 -r 46218c8b8afa Symbian3/PDK/Source/GUID-7E967B81-2DBF-5A89-B74B-93FEA5515685.dita --- a/Symbian3/PDK/Source/GUID-7E967B81-2DBF-5A89-B74B-93FEA5515685.dita Thu Mar 11 15:24:26 2010 +0000 +++ b/Symbian3/PDK/Source/GUID-7E967B81-2DBF-5A89-B74B-93FEA5515685.dita Thu Mar 11 18:02:22 2010 +0000 @@ -1,31 +1,31 @@ - - - - - -How -to use new with automatic leave on failureProvides code snippets to show you how to use new with -automatic leave on failure -

The case of new failing is so common that a version of operator -new() has been written which takes a single parameter ELeave, -indicating that it must leave if it was unable to allocate memory.

-

Use operator new() so that there is no need to check the -result of the new.

-void doExampleL() - { - // attempt to allocate, leave if could not - CExample* myExample = new (ELeave) CExample; - // new (ELeave) replaces new followed by check - // do something - myExample->iInt = 5; - testConsole.Printf(_LIT("Value of iInt is %d.\n"),myExample->iInt); - // delete - delete myExample; - } + + + + + +How +to use new with automatic leave on failureProvides code snippets to show you how to use new with +automatic leave on failure +

The case of new failing is so common that a version of operator +new() has been written which takes a single parameter ELeave, +indicating that it must leave if it was unable to allocate memory.

+

Use operator new() so that there is no need to check the +result of the new.

+void doExampleL() + { + // attempt to allocate, leave if could not + CExample* myExample = new (ELeave) CExample; + // new (ELeave) replaces new followed by check + // do something + myExample->iInt = 5; + testConsole.Printf(_LIT("Value of iInt is %d.\n"),myExample->iInt); + // delete + delete myExample; + }
\ No newline at end of file