Short question: Is there a shorter way to do this
array<array<atomic<int>,n>,m> matrix;
I was hoping for something like
array< atomic< int>,n,m> matrix;
but it doesnt work...
A template alias might help out:
#include <array> template <class T, unsigned I, unsigned J> using Matrix = std::array<std::array<T, J>, I>; int main() { Matrix<int, 3, 4> matrix; }
2.1m questions
2.1m answers
60 comments
57.0k users