mirror of
https://github.com/elasota/Aerofoil.git
synced 2025-12-13 19:49:36 +00:00
Add some initial widget functionality (prefs partly working)
This commit is contained in:
@@ -23,8 +23,13 @@ private:
|
||||
size_t m_count;
|
||||
};
|
||||
|
||||
#include "CoreDefs.h"
|
||||
#include "PLArrayViewIterator.h"
|
||||
|
||||
#if GP_DEBUG_CONFIG
|
||||
#include <assert.h>
|
||||
#endif
|
||||
|
||||
template<class T>
|
||||
inline ArrayView<T>::ArrayView(const T *items, size_t count)
|
||||
: m_items(items)
|
||||
@@ -48,17 +53,29 @@ inline size_t ArrayView<T>::Count() const
|
||||
template<class T>
|
||||
const T &ArrayView<T>::operator[](size_t index) const
|
||||
{
|
||||
#if GP_DEBUG_CONFIG
|
||||
assert(index < m_count);
|
||||
#endif
|
||||
|
||||
return m_items[index];
|
||||
}
|
||||
|
||||
template<class T>
|
||||
inline ArrayViewIterator<T> ArrayView<T>::begin() const
|
||||
{
|
||||
#if GP_DEBUG_CONFIG
|
||||
return ArrayViewIterator<T>(m_items, m_count, 0);
|
||||
#else
|
||||
return ArrayViewIterator<T>(m_items);
|
||||
#endif
|
||||
}
|
||||
|
||||
template<class T>
|
||||
inline ArrayViewIterator<T> ArrayView<T>::end() const
|
||||
{
|
||||
#if GP_DEBUG_CONFIG
|
||||
return ArrayViewIterator<T>(m_items, m_count, m_count);
|
||||
#else
|
||||
return ArrayViewIterator<T>(m_items + m_count);
|
||||
#endif
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user