4 ms·
Do you mean std::array<T,N>? ( https://en.cppreference.com/w/cpp/container/array https://en.cppreference.com/w/cpp/container/array )
by nayuki 6y ago
Do you mean std::array<T,N>? ( https://en.cppreference.com/w/cpp/container/array https://en.cppreference.com/w/cpp/container/array )
- reader_mode 6y agoVector<T, N> an Matrix<T, N> is a fancy way to do small linear algebra types - like 2,3,4 vector and 3x3/4x4 matrix - you implement simple operations like add, multiply and dot products with loops and the compiler will unroll it and then you add some specific overloads for stuff like cross product, etc. Saves you having to reimplement it for every N. It's the simplest case of this kind of metaprogramming and feels good once you discover this kind of generalisation.