Symbian Developer Library

SYMBIAN OS V6.1 EDITION FOR C++

[Index] [Glossary] [Previous] [Next]



The range checking wrapper for fixed length C++ arrays

The C++ language provides fixed length arrays.

It is often convenient to use these arrays in applications whenever the number of elements is fixed and known at compile time.

The main disadvantage of using C++ arrays is that there is no automatic checking of index values.

The templated class TFixedArray<class T,TInt S>, is a thin wrapper for C++ arrays.

The major benefits of using this class over a basic C++ array are the provision of range-checked indexing and support for object deletion. There is no runtime penalty for using this class if debug-only range-checking is used.

The class can be embedded as a data memnber of CBase derived objects and it can also be used on the program stack.