Symbian3/PDK/Source/GUID-7E967B81-2DBF-5A89-B74B-93FEA5515685.dita
changeset 14 578be2adaf3e
parent 5 f345bda72bc4
--- a/Symbian3/PDK/Source/GUID-7E967B81-2DBF-5A89-B74B-93FEA5515685.dita	Tue Jul 20 12:00:49 2010 +0100
+++ b/Symbian3/PDK/Source/GUID-7E967B81-2DBF-5A89-B74B-93FEA5515685.dita	Fri Aug 13 16:47:46 2010 +0100
@@ -1,31 +1,31 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies) All rights reserved. -->
-<!-- This component and the accompanying materials are made available under the terms of the License 
-"Eclipse Public License v1.0" which accompanies this distribution, 
-and is available at the URL "http://www.eclipse.org/legal/epl-v10.html". -->
-<!-- Initial Contributors:
-    Nokia Corporation - initial contribution.
-Contributors: 
--->
-<!DOCTYPE concept
-  PUBLIC "-//OASIS//DTD DITA Concept//EN" "concept.dtd">
-<concept id="GUID-7E967B81-2DBF-5A89-B74B-93FEA5515685" xml:lang="en"><title>How
-to use new with automatic leave on failure</title><shortdesc>Provides code snippets to show you how to use <codeph>new</codeph> with
-automatic leave on failure</shortdesc><prolog><metadata><keywords/></metadata></prolog><conbody>
-<p>The case of <codeph>new</codeph> failing is so common that a version of <codeph>operator
-new()</codeph> has been written which takes a single parameter <codeph>ELeave</codeph>,
-indicating that it must leave if it was unable to allocate memory.</p>
-<p>Use <codeph>operator new()</codeph> so that there is no need to check the
-result of the <codeph>new</codeph>.</p>
-<codeblock id="GUID-E898C802-28E7-5330-B4F1-08829BECB4AE" xml:space="preserve">void doExampleL()
- {
- // attempt to allocate, leave if could not
- CExample* myExample = new (ELeave) CExample;
- // new (ELeave) replaces new followed by check
- // do something
- myExample-&gt;iInt = 5;
- testConsole.Printf(_LIT("Value of iInt is %d.\n"),myExample-&gt;iInt);
- // delete
- delete myExample;
- }</codeblock>
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies) All rights reserved. -->
+<!-- This component and the accompanying materials are made available under the terms of the License 
+"Eclipse Public License v1.0" which accompanies this distribution, 
+and is available at the URL "http://www.eclipse.org/legal/epl-v10.html". -->
+<!-- Initial Contributors:
+    Nokia Corporation - initial contribution.
+Contributors: 
+-->
+<!DOCTYPE concept
+  PUBLIC "-//OASIS//DTD DITA Concept//EN" "concept.dtd">
+<concept id="GUID-7E967B81-2DBF-5A89-B74B-93FEA5515685" xml:lang="en"><title>How
+to use new with automatic leave on failure</title><shortdesc>Provides code snippets to show you how to use <codeph>new</codeph> with
+automatic leave on failure</shortdesc><prolog><metadata><keywords/></metadata></prolog><conbody>
+<p>The case of <codeph>new</codeph> failing is so common that a version of <codeph>operator
+new()</codeph> has been written which takes a single parameter <codeph>ELeave</codeph>,
+indicating that it must leave if it was unable to allocate memory.</p>
+<p>Use <codeph>operator new()</codeph> so that there is no need to check the
+result of the <codeph>new</codeph>.</p>
+<codeblock id="GUID-E898C802-28E7-5330-B4F1-08829BECB4AE" xml:space="preserve">void doExampleL()
+ {
+ // attempt to allocate, leave if could not
+ CExample* myExample = new (ELeave) CExample;
+ // new (ELeave) replaces new followed by check
+ // do something
+ myExample-&gt;iInt = 5;
+ testConsole.Printf(_LIT("Value of iInt is %d.\n"),myExample-&gt;iInt);
+ // delete
+ delete myExample;
+ }</codeblock>
 </conbody></concept>
\ No newline at end of file