Clarisse 5.0 SP8 SDK  5.0.5.8.0
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
Public Member Functions | Static Public Member Functions | List of all members
CoreStaticArray< T, SIZE > Class Template Reference
Inheritance diagram for CoreStaticArray< T, SIZE >:
CoreBasicArray< T > CoreBaseType

Public Member Functions

 CoreStaticArray (void)
 Default constructor.
 
 CoreStaticArray (const T(&array)[SIZE])
 
const CoreClassInfoget_class_info () const
 
- Public Member Functions inherited from CoreBasicArray< T >
 CoreBasicArray ()
 Empty constructor.
 
 CoreBasicArray (T *array, unsigned int count, unsigned int capacity=0)
 Default constructor.
 
 CoreBasicArray (const CoreBasicArray< T > &src)
 Copy constructor.
 
 CoreBasicArray (CoreBasicArray< T > &&src) noexcept
 Move constructor.
 
- Public Member Functions inherited from CoreBaseType
bool is_kindof (const CoreClassInfo &cinfo) const
 

Static Public Member Functions

static const CoreClassInfoclass_info ()
 

Additional Inherited Members

- Static Public Attributes inherited from CoreBasicArray< T >
static constexpr unsigned int INVALID_INDEX = CORE_INVALID_INDEX
 For backward compatibility. Use CORE_INVALID_INDEX instead.
 

Detailed Description

template<class T, unsigned int SIZE>
class CoreStaticArray< T, SIZE >

Stack allocated array with a CoreBasicArray interface.

Constructor & Destructor Documentation

template<class T , unsigned int SIZE>
CoreStaticArray< T, SIZE >::CoreStaticArray ( const T(&)  array[SIZE])
inline

Initializer list like constructor. Do not allocate on the heap.

Note
I don't not use std::initializer_list here because we can't statically assert that the number of items in array matches the class' template parameter SIZE. Using this signature, it will issue a compile time error if such a mismatch happens, while still allowing writing: CoreStaticArray<int, 2> foo({ 4, 2 });