text
stringlengths
0
2.2M
}
template<class VALUE, int SIZE>
typename MyFixedSizeArray<VALUE,SIZE>::iterator
MyFixedSizeArray<VALUE,SIZE>::end()
{
return d_array + SIZE;
}
template<class VALUE, int SIZE>
typename MyFixedSizeArray<VALUE,SIZE>::reverse_iterator
MyFixedSizeArray<VALUE,SIZE>::rbegin()
{
return reverse_iterator(end());
}
template<class VALUE, int SIZE>
typename MyFixedSizeArray<VALUE,SIZE>::reverse_iterator
MyFixedSizeArray<VALUE,SIZE>::rend()
{
return reverse_iterator(begin());
}
template<class VALUE, int SIZE>
inline VALUE& MyFixedSizeArray<VALUE,SIZE>::operator[](int i)
{
return d_array[i];
}
// ACCESSORS
template<class VALUE, int SIZE>
typename MyFixedSizeArray<VALUE,SIZE>::const_iterator
MyFixedSizeArray<VALUE,SIZE>::begin() const
{
return d_array;
}
template<class VALUE, int SIZE>
typename MyFixedSizeArray<VALUE,SIZE>::const_iterator
MyFixedSizeArray<VALUE,SIZE>::end() const
{
return d_array + SIZE;
}
template<class VALUE, int SIZE>
typename MyFixedSizeArray<VALUE,SIZE>::const_reverse_iterator
MyFixedSizeArray<VALUE,SIZE>::rbegin() const
{
return const_reverse_iterator(end());
}
template<class VALUE, int SIZE>
typename MyFixedSizeArray<VALUE,SIZE>::const_reverse_iterator
MyFixedSizeArray<VALUE,SIZE>::rend() const
{
return const_reverse_iterator(begin());
}
template<class VALUE, int SIZE>
inline int MyFixedSizeArray<VALUE,SIZE>::size() const
{
return SIZE;
}
template<class VALUE, int SIZE>
inline
const VALUE& MyFixedSizeArray<VALUE,SIZE>::operator[](int i) const
{
return d_array[i];
}
// FREE FUNCTIONS
template<class VALUE, int SIZE>
bool operator==(const MyFixedSizeArray<VALUE,SIZE>& lhs,
const MyFixedSizeArray<VALUE,SIZE>& rhs)
{
if (lhs.size() != rhs.size()) {
return false; // RETURN
}
for (int i = 0; i < lhs.size(); ++i) {
if (lhs[i] != rhs[i]) {
return false; // RETURN
}
}
return true;
}
class AccessTestContainer
// This is a container that contains a fixed number of elements. The
// number of elements is specified upon construction and can not be
// changed afterwards.
{
// TYPES
enum {
e_BEGIN = 1,
e_CONST_BEGIN = 2,
e_REVERSE_BEGIN = 4,
e_CONST_REVERSE_BEGIN = 8,
e_END = 16,
e_CONST_END = 32,