std::array vs array performance

What are the advantages of using std::array over usual ones?

It has friendly value semantics, so that it can be passed to or returned from functions by value. Its interface makes it more convenient to find the size, and use with STL-style iterator-based algorithms.

Is it more performant ?

It should be exactly the same. By definition, it’s a simple aggregate containing an array as its only member.

Just easier to handle for copy/access ?

Yes.

Leave a Comment