(C++) std::array
February 24, 2017 · View on GitHub
(C++) std::array
std::array is part of the C++11 STL library and supplies an array class.
Examples
- std::array example 1: basics
- std::array example 2: std::array as member variable
- std::array example 3: 2D std::array
Advice
- Prefer std::array to built-in arrays [1-4]
References
- Scott Meyers. C++ And Beyond 2012 session: 'Initial thoughts on Effective C++11'. 2012. 'Prefer std::array to Built-in Arrays'
- Scott Meyers. Effective Modern C++ (1st Edition). 2014. ISBN: 978-1-491-90399-5. Item 1, page 17: 'Of course, as a modern C++ developer, you'd naturally preder a std::array to a built-in array'
- Bjarne Stroustrup. A tour of C++. 2014. ISBN: 978-0-321-958310. Chapter 11.7.11: 'Prefer array over built-in arrays'
- Bjarne Stroustrup. The C++ Programming Language (4th edition). 2013. ISBN: 978-0-321-56384-2. Chapter 34.7. Advice. page 1007: '[2] Prefer array over built-in arrays'