3 ms·
No, compilers cannot do that. Who says that it is not the case that in one cpp file the data access pattern is completely different than in another cpp file? He
by cjfd 5y ago
No, compilers cannot do that. Who says that it is not the case that in one cpp file the data access pattern is completely different than in another cpp file? Hence, it may be that for one ccp file the most efficient way would be to have an array of structs and for another cpp file the most efficient way would be a struct of arrays. The compiler cannot possibly know this so it has to follow the data layout that the programmer has specified.