is there any performance gap using auto instead of int or other
type? For example

int[] ar1 = new int[1000];
auto[] ar2 = new int[1000];

are these equivalent by a perfomance point of view?

Well the runtime performance is equal but of course compilation takes slightly longer since it has to deduce the type first. But in general you should only use auto if it doesn't make your code harder to understand (e.g. auto x = funcThatDoesCrazyShitYouCantGuessFromTheName(); // so, what's the type of x???).

Also it's 'auto ar2' instead of 'auto[] ar2'.

Reply via email to