Created
May 21, 2014 13:12
-
-
Save ibab/11250ecf97b40d9c3049 to your computer and use it in GitHub Desktop.
array2d
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <vector> | |
#include <iostream> | |
#include <array> | |
#include <algorithm> | |
template <class T, unsigned I, unsigned J> | |
using array2d = std::array<std::array<T, J>, I>; | |
int main(int argc, char *argv[]) | |
{ | |
array2d<double, 10, 10> test{}; | |
test[5][5] = 42; | |
for (std::size_t i=0; i<test.size(); i++) { | |
for (std::size_t j=0; j<test[0].size(); j++) { | |
std::cout << test[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