template<
typename T>
class Ogre::FastArray< T >
Lightweight implementation of std::vector.
- Since we can't enable/disable those checkings selectively, I wrote our own lightweight container for performance-sensitive areas where we're also very certain we won't use them incorrectly.
- It's partially STL compliant, for example std::for_each works with it. However some functions are not, for example FastArray<int> myArray(5) does not behave as the standard does: FastArray will reserve 5 ints, while std::vector will push 5 ints and default-initialize them (in the case of ints, fill it with 5 zeros)
- Only use this container for extremely performance sensitive and you're certain you'll be using it correctly. If you're in doubt or don't know what to do, use std::vector instead.
- FastArray was created because we needed to keep multiple lists (one per thread) of culled MovableObjects pointers (against the camera) and then iterate through all of them. These multiple levels of indirection was causing MS implementation to go mad with a huge amount of useless bounds checking & iterator validation.
- Author
- Matias N. Goldberg
- Version
- 1.0