matrix: add data accessor function

This commit is contained in:
Danny Robson 2017-01-05 19:49:43 +11:00
parent faf7e68671
commit 4566141855
2 changed files with 21 additions and 0 deletions

View File

@ -36,6 +36,9 @@ namespace util {
T* operator[] (size_t);
const T* operator[] (size_t) const;
T* data (void);
const T* data (void) const;
const T* begin (void) const;
const T* end (void) const;
T* begin (void);

View File

@ -40,6 +40,24 @@ util::matrix<S,T>::operator[] (size_t idx) const
}
//-----------------------------------------------------------------------------
template <size_t S, typename T>
T*
util::matrix<S,T>::data (void)
{
return begin ();
}
//-----------------------------------------------------------------------------
template <size_t S, typename T>
const T*
util::matrix<S,T>::data (void) const
{
return begin ();
}
//-----------------------------------------------------------------------------
template <size_t S, typename T>
const T*