valarray vs. vector: Why was valarray introduced?
问题 Yes, this has been asked before, and the answer has been: valarray s (value arrays) are intended to bring some of the speed of Fortran to C++. You wouldn't make a valarray of pointers so the compiler can make assumptions about the code and optimise it better. (The main reason that Fortran is so fast is that there is no pointer type so there can be no pointer aliasing.) or: valarray is also supposed to eliminate any possibility of aliasing [...] But these answers make no sense to me. valarray