Tag Archives: std::array

Bitesize Modern C++ : std::array

Technical Consultant at Feabhas Ltd
Glennan is an embedded systems and software engineer with over 20 years experience, mostly in high-integrity systems for the defence and aerospace industry.

He specialises in C++, UML, software modelling, Systems Engineering and process development.
Glennan Carnie

C++98 inherited C’s only built-in container, the array. Arrays of non-class types behave in exactly the same way as they do in C. For class types, when an array is constructed the default constructor is called on each element in the array

Explicitly initialising objects in an array is one of the few times you can explicitly invoke a class’s constructor.

For track[], the non-default constructor is called for first three elements, followed by default (no parameter) constructor for the last two […]

Posted in C/C++ Programming | Tagged , , , , , | Leave a comment