Pretends to have a variable-size (but underlying array is fixed-size).
More...
#include <_src_base_array_small.hh>
List of all members.
Detailed Description
template<uint FIXED_SIZE, typename T = int>
class base::SmallArray< FIXED_SIZE, T >
Pretends to have a variable-size (but underlying array is fixed-size).
Limited-use (for speed/memory optimization).
Like TinyArray, SmallArray's underlying array really is fixed-size, but SmallArray pretends to have variable-size which allows push_back(), size(), resize(). SmallArray's advantage over STL vector is reduced memory consumption and allocation.
NOTE: resize() will fail if new size is beyond fixed-size.
Usage: ------ This pre-allocates space for 256 elements (FIXED-SIZE). But its VARIABLE-SIZE is zero: empty() and size() indicate zero elements!
SmallArray<256,int> array; if ( array.empty() ) Func(); // yes, Func() will be called
Idiom: SmallArray<1000,int> array( 1000 ); // fixed-size = variable-size
Member Typedef Documentation
template<uint FIXED_SIZE, typename T = int>
Constructor & Destructor Documentation
template<uint FIXED_SIZE, typename T = int>
template<uint FIXED_SIZE, typename T = int>
Member Function Documentation
template<uint FIXED_SIZE, typename T = int>
template<uint FIXED_SIZE, typename T = int>
template<uint FIXED_SIZE, typename T = int>
template<uint FIXED_SIZE, typename T = int>
template<uint FIXED_SIZE, typename T = int>
template<uint FIXED_SIZE, typename T = int>
Amazing that a C++ compiler will accept how this type is written.
template<uint FIXED_SIZE, typename T = int>
template<uint FIXED_SIZE, typename T = int>
template<uint FIXED_SIZE, typename T = int>
Catching access to an uninitialized element would be ideal but there's no way to tell if the element is being read or written.
template<uint FIXED_SIZE, typename T = int>
template<uint FIXED_SIZE, typename T = int>
template<uint FIXED_SIZE, typename T = int>
template<uint FIXED_SIZE, typename T = int>
Limited STL compatibility.
Member Data Documentation
template<uint FIXED_SIZE, typename T = int>
template<uint FIXED_SIZE, typename T = int>
The documentation for this class was generated from the following file: