I'm wondering what happen internally when I define a constexpr variable inside a function. Is the program storing each version of the called function's constexpr variables ?
Example:
template <class T, std::size_t M, std::size_t N>
template <std::size_t M2, std::size_t N2>
Matrix<T, M, N>::Matrix(const Matrix<T, M2, N2>& m)
{
constexpr T m_min(MATHS::min(M, M2));
constexpr T n_min(MATHS::min(N, N2));
std::size_t i(0), j(0);
for ( ; i < m_min ; ++i )
{
for ( j = 0 ; j < n_min ; ++j )
m_elts[i][j] = m.m_elts[i][j];
for ( ; j < N ; ++j )
m_elts[i][j] = MATHS::CST<T>::ZERO;
}
for ( ; i < M ; ++i )
{
for ( j = 0 ; j < N ; ++j )
m_elts[i][j] = MATHS::CST<T>::ZERO;
}
}
//m_elts is : std::array<std::array<T, N>, M> m_elts;