mercredi 25 avril 2018

Difference between T[N] and std::array

My question is pretty straightforward, but to be more specific I want to quote 2 lines from Stroustrup11.

  1. T[N] A fixed-size built-in array: N contiguous elements of type T; no size() or other member functions
  2. array<T,N> A fixed-size array of N contiguous elements of type T; like the built-in array, but with most problems solved

So what is the difference the author is mentioning? And what problems are solved for std::array<T,N> ?

Aucun commentaire:

Enregistrer un commentaire