the xbox is most definitly a multitasking environment
Actually, no. The XBOX (not XBOX360) kernel does not support more than one XBE (XBOX Executable) running at any given time, nor does it support DLLs.
It wouldn't be feasible with only 64MB, which has to be shared between the program and the framebuffer.
Also, all XBOX software runs in ring 0, for performance reasons, but that's beyond the point.
My point was that in a multitasking environment, you should never, ever use array offset operators, for the obvious reasons. On the XBOX, you might get away with this, but I don't advise it, regardless.
There is no case in which a variable sized array can be implicitly declared. It simply doesnt work.
How about this, then?
It's in my implementation of mscorlib.dll
Apparently, a template class
can have an array of unspecified size.
Or at least, it doesn't throw any errors with warnings set at W3
Code: Select all
template <class T>
class List
{
private:
T internalArray[];
public:
int Count();
int Capacity();
void Capacity(int value);
List();
List(int size);
List(T collection[]);
void Add(T &item);
void Clear();
bool Contains(T &item);
bool Remove(T &item);
void RemoveAt(int index);
void Reverse();
T *ToArray();
void TrimExcess();
};