[Issue 12489] std.bitmanip byte swapping routines should be partially instantiable

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sun Mar 30 05:45:57 PDT 2014


https://d.puremagic.com/issues/show_bug.cgi?id=12489



--- Comment #4 from Andrej Mitrovic <andrej.mitrovich at gmail.com> 2014-03-30 14:45:56 CEST ---
(In reply to comment #3)
> (In reply to comment #0)
> >     @Converter!(littleEndianToNative!ushort)
> >     ushort reserved1;
> 
> I don't know the context, but there's some redundancy here already (ushort is
> listed twice). Any reason you can't use `@Converter!littleEndianToNative` ?

Yeah you're right, I don't need to embed this information. It's really nice
that I can now write:

struct Header
{
    @Converter!littleEndianToNative
    {
        ushort reserved1;

        ushort ordnum;

        ushort insnum;

        ushort patnum;

        ushort flags;

        ushort cwtv;

        ushort version_;
    }
}

-- 
Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list