43 lines
1.2 KiB
C++
43 lines
1.2 KiB
C++
/**
|
|
This file is a part of the rexy/r0nk/atlas project
|
|
Copyright (C) 2020 rexy712
|
|
|
|
This program is free software: you can redistribute it and/or modify
|
|
it under the terms of the GNU General Public License as published by
|
|
the Free Software Foundation, either version 3 of the License, or
|
|
(at your option) any later version.
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
GNU General Public License for more details.
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
*/
|
|
|
|
#ifndef REXY_DETAIL_MATRIX_TPP
|
|
#define REXY_DETAIL_MATRIX_TPP
|
|
|
|
#include <cstdlib> //size_t
|
|
#include <utility> //integer_sequence
|
|
|
|
namespace math::detail{
|
|
|
|
template<typename T, size_t R>
|
|
constexpr mat_ref_obj<T,R>::mat_ref_obj(T* d, size_type i):
|
|
m_data(d+i){}
|
|
|
|
template<typename T, size_t R>
|
|
constexpr T& mat_ref_obj<T,R>::operator[](size_type i){
|
|
return m_data[i*R];
|
|
}
|
|
template<typename T, size_t R>
|
|
constexpr const T& mat_ref_obj<T,R>::operator[](size_type i)const{
|
|
return m_data[i*R];
|
|
}
|
|
|
|
}
|
|
|
|
#endif
|