diff -r ebc84c812384 -r 46218c8b8afa Symbian3/PDK/Source/GUID-FD5C6057-C6D3-5C1A-888C-7B7A3C89CD67.dita --- a/Symbian3/PDK/Source/GUID-FD5C6057-C6D3-5C1A-888C-7B7A3C89CD67.dita Thu Mar 11 15:24:26 2010 +0000 +++ b/Symbian3/PDK/Source/GUID-FD5C6057-C6D3-5C1A-888C-7B7A3C89CD67.dita Thu Mar 11 18:02:22 2010 +0000 @@ -1,38 +1,38 @@ - - - - - -How to -use the range checking wrapperSymbian platform provides range checking for arrays. -

Instead of declaring a C++ array directly:

-TTest array[4]; -

use:

-TFixedArray<TTest,4> array; -
Initialise array

The array can be initialised either -at construction time or by using the Copy() member function -after construction.

... -const TTest data[] = {TTest(1),TTest(2),TTest(3),TTest(4)}; -... - // initialise at construction time -TFixedArray<TTest,4> array(&data[0],4); -... - // or later using Copy() -TFixedArray<TTest,4> array; -array.Copy(&data[0],4); -...
-
Check accesses for legality

Accesses can be checked -for legality using the At() function or the operator[].

The At() function -checks for a legal access in both a release build and a debug build while -the operator[] only checks for a legal access in a debug -build.

Assuming that the TTest class has a public -member function called SetValue(), then a call to this function -on the second element of the array is legal:

array.At(1).SetValue(100);

but an attempt to call this function on the fifth element raises a panic; -in this example, there are only four elements:

array.At(5).SetValue(100); // panics
+ + + + + +How to +use the range checking wrapperSymbian platform provides range checking for arrays. +

Instead of declaring a C++ array directly:

+TTest array[4]; +

use:

+TFixedArray<TTest,4> array; +
Initialise array

The array can be initialised either +at construction time or by using the Copy() member function +after construction.

... +const TTest data[] = {TTest(1),TTest(2),TTest(3),TTest(4)}; +... + // initialise at construction time +TFixedArray<TTest,4> array(&data[0],4); +... + // or later using Copy() +TFixedArray<TTest,4> array; +array.Copy(&data[0],4); +...
+
Check accesses for legality

Accesses can be checked +for legality using the At() function or the operator[].

The At() function +checks for a legal access in both a release build and a debug build while +the operator[] only checks for a legal access in a debug +build.

Assuming that the TTest class has a public +member function called SetValue(), then a call to this function +on the second element of the array is legal:

array.At(1).SetValue(100);

but an attempt to call this function on the fifth element raises a panic; +in this example, there are only four elements:

array.At(5).SetValue(100); // panics
\ No newline at end of file