d - Preferred foreach Index Type -


what preferred type loop indexes when using foreach in d, int, uint or automatic omitting type?

in general, indices should size_t. same length. you're going have issues 32-bit vs 64-bit machines if try , use int or uint. size_t language uses array indices , length. it's aliased uint on 32-bit machines , ulong on 64-bit machines.

so, if you're going give index type, give size_t. however, type inferred size_t foreach when iterating on array. so, in cases, there's no reason list type.


Comments

Popular posts from this blog

How to remove text and logo OR add Overflow on Android ActionBar using AppCompat on API 8? -

html - How to style widget with post count different than without post count -

url rewriting - How to redirect a http POST with urlrewritefilter -