Add some initial widget functionality (prefs partly working)

This commit is contained in:
elasota
2020-01-01 20:24:46 -05:00
parent d9b5dd20d6
commit 5fe6218c28
85 changed files with 2131 additions and 1074 deletions

View File

@@ -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
}