Skip to content

Instantly share code, notes, and snippets.

@emersonmx
Last active June 23, 2016 16:34
Show Gist options
  • Select an option

  • Save emersonmx/a868f765f8c1c36bc0179e6328d1eae5 to your computer and use it in GitHub Desktop.

Select an option

Save emersonmx/a868f765f8c1c36bc0179e6328d1eae5 to your computer and use it in GitHub Desktop.
/**
* make testearr && ./testearr
*/
#include <iostream>
#include <array>
template <typename T, std::size_t I, std::size_t J>
using Matrix = std::array< std::array<T, J>, I>;
int main() {
Matrix<int, 3, 2> m {
1, 2,
3, 4,
5, 6
};
for (int i = 0; i < m.size(); ++i) {
for (int j = 0; j < m[i].size(); ++j) {
std::cout << m[i][j] << " ";
}
std::cout << std::endl;
}
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment