coutで多次元配列のdump

何かの役に立つかも

実行結果 http://melpon.org/wandbox/permlink/MJN1EGWMw1ixnvBJ

#include <iostream>

template <typename T, std::size_t N>
std::ostream& operator<< (std::ostream& os, const T(&arr)[N]) {
    os << '{';
    std::size_t i = 0;
    for (const auto& v : arr) {
        os << v;
        if (++i != N) { os << ',' << ' '; }
    }
    os << '}';
    return os;
}

int main() {
    int arr[][2][6] = {{{0, 1, 2, 3, 4, 5}, {0, 1, 2, 3, 4, 5}}, {{0, 1, 2, 3, 4, 5}, {0, 1, 2, 3, 4, 5}}};
    std::cout << arr << std::endl;
}

出力

{{{0, 1, 2, 3, 4, 5}, {0, 1, 2, 3, 4, 5}}, {{0, 1, 2, 3, 4, 5}, {0, 1, 2, 3, 4, 5}}}