You need extra brackets, until c++14 proposal kicks in.
std::array<std::array<int, 3>, 3> arr = {{{5, 8, 2}, {8, 3, 1}, {5, 3, 9}}};
More Related Contents:
- c++ push reference node to stl list
- Erasing elements from a vector
- Why can’t I make a vector of references?
- Concise explanation of reference collapsing rules requested: (1) A& & -> A& , (2) A& && -> A& , (3) A&& & -> A& , and (4) A&& && -> A&&
- Why do I get the same sequence for every run with std::random_device with mingw gcc4.8.1?
- Using custom std::set comparator
- When vectors are allocated, do they use memory on the heap or the stack?
- In STL maps, is it better to use map::insert than []?
- Why use non-member begin and end functions in C++11?
- std::fstream doesn’t create file
- Where can I get a “useful” C++ binary search algorithm?
- Relative performance of std::vector vs. std::list vs. std::slist?
- Stack-buffer based STL allocator?
- std::sort does not always call std::swap
- How to use std::sort with a vector of structures and compare function?
- std::vector, default construction, C++11 and breaking changes
- How to read a growing text file in C++?
- Why is value taking setter member functions not recommended in Herb Sutter’s CppCon 2014 talk (Back to Basics: Modern C++ Style)?
- Initial capacity of vector in C++
- std::vector iterator invalidation
- Non-copyable elements in vector
- How to pretty-print STL containers in GDB?
- How to make elements of vector unique? (remove non adjacent duplicates)
- How does overloading of const and non-const functions work?
- How can I use Standard Library (STL) classes in my dll interface or ABI?
- How can i estimate memory usage of std::map?
- Memory allocation and deallocation across dll boundaries
- STL deque accessing by index is O(1)?
- Incrementing iterators: Is ++it more efficient than it++? [duplicate]
- list of polymorphic objects