byte and short data types use cases

Murloc justanotheraccount3212334 at proton.me
Fri Jun 9 15:07:54 UTC 2023


On Friday, 9 June 2023 at 12:56:20 UTC, Cecil Ward wrote:
> On Friday, 9 June 2023 at 11:24:38 UTC, Murloc wrote:
>
> If you have four ubyte variables in a struct and then
> an array of them, then you are getting optimal memory usage.

Is this some kind of property? Where can I read more about this?

So you can optimize memory usage by using arrays of things 
smaller than `int` if these are enough for your purposes, but 
what about using these instead of single variables, for example 
as an iterator in a loop, if range of such a data type is enough 
for me? Is there any advantages on doing that?


More information about the Digitalmars-d-learn mailing list