Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. CONice that you've been thinking about this and write well, but your reasoning is flawed by 2 oversights: 1) dynamic allocation using `vector<>` has the compelling benefit of resizing and continuing to run, whereas compile-time array sizing wastes memory when there are fewer elements, then fails totally. 2) `vector` *does* have value semantics (that C++ lets you create user-defined types with value semantics is a critical and very deliberate language feature), and `vector`s are therefore automatically handled properly by default-generated destructors and copy constructors.
      singulars
    2. CO@Tony You are correct, I am not advocating using `std::array` over `std::array`. I am advising against prematurely using `std::vector` over `std::array` *as a member* solely on the grounds that it would make a leaner object. Choosing between `std::array` or `std::vector` (as a member or not) is another discussion altogether, and you already provided some arguments on the subject.
      singulars
    3. CO@Luc: if your "leaner object" caveat is warning that say a `vector` with size N will not be as "lean" as an array of size N that's certainly true, but vectors definitely come into their own when the populated size is significantly less than the capacity N, and in resizing beyond the current capacity on demand. `vector`s value semantics make them well-behaved members, and they should be selected in preference to arrays in general use. Using `array` habitually would be the "premature" choice, as it's normally hard to choose a good capacity. I'm still not sure if you're agreeing or not? :-)
      singulars
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload