D and memory mapped devices

Jacob Carlborg via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Wed Jun 14 12:10:56 PDT 2017


On 2017-06-14 11:04, Rene Zwanenburg wrote:

> I've casted void buffers to structs containing bitfields to read
> pre-existing binary files, and that worked just fine. I don't see why it
> would be different for memory mapped devices. What do yo mean by 'do more'?

This bitfield discussion came up in a DStep issue [1]. The bitfields 
mixin will generate a field to store the bits in, which I think was 
surprising for Russel. Although, currently there are no other way to 
specify which other field should be used for storage.

Another issue that came up is that you can use the default generated 
constructor or the struct initializer syntax to bypass the generate 
methods and set the underlying storage field directly.

[1] https://github.com/jacob-carlborg/dstep/issues/151

-- 
/Jacob Carlborg


More information about the Digitalmars-d-learn mailing list