On Monday, 30 July 2012 at 17:15:54 UTC, Andrej Mitrovic wrote:
On 7/30/12, Ali Çehreli <acehr...@yahoo.com> wrote:
The program should be able to detect the placements of the fields. You can expect a certain bit pattern for a given set of values of the bit fields, set those values, read them on the D side, detect potential inconsistencies, and fail the execution (or hopefully compilation).

Yeah that was exactly my thinking, these things can be automated
although they might slow down the whole codegeneration process a
little bit (not that it matters much since you would rarely have to
regenerate).

Btw, I get an internal std error with this mixin:

import std.bitmanip;
struct Foo
{
    mixin(bitfields!(
        uint, "bits1", 32,
    ));
}

D:\DMD\dmd2\windows\bin\..\..\src\phobos\std\bitmanip.d(76): Error:
shift by 32 is outside the range 0..31

Should I file this?

Yes, that should work.

By the way, what's a "butfield"?

Reply via email to