# 15.1.1.8. StackAllocatedSequence¶

template<typename T, LoanableCollection::size_type num_items>
struct eprosima::fastdds::dds::StackAllocatedSequence : public eprosima::fastdds::dds::LoanableCollection

A type-safe, ordered collection of elements allocated on the stack.

Public Functions

T &operator[](size_type n)

Set an element of the sequence.

This is the operator that is invoked when the application indexes into a non-const sequence:

element = sequence[n];
sequence[n] = element;


Note that a reference to the element is returned (and not a copy)

Return

a reference to the element at position n

Parameters
• [in] n: index of element to access, must be >= 0 and less than length().

const T &operator[](size_type n) const

Get an element of the sequence.

This is the operator that is invoked when the application indexes into a const sequence:

element = sequence[n];


Note that a reference to the element is returned (and not a copy)

Return

a const reference to the element at position

Parameters
• [in] n: index of element to access, must be >= 0 and less than length().