auto

David Nadlinger see at klickverbot.at
Thu Nov 24 13:05:13 PST 2011


On 11/24/11 9:59 PM, RexLen wrote:
> Just curious:
> 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?

The actual type »auto« represents is determined during compilation, so 
there is no difference in the final executable. If you wanted to 
actually use a type not known statically, I'd have a look at std.variant.

Hope this helps,
David


More information about the Digitalmars-d-learn mailing list