My thoughts & experiences with D so far, as a novice D coder

Chris Cain clcain at uncg.edu
Thu Mar 28 15:24:48 PDT 2013


On Thursday, 28 March 2013 at 22:22:49 UTC, Chris Cain wrote:
> ---
> ubyte[T.sizeof] toUbytes(T)(T val) @safe {
>     ubyte[T.sizeof] buf;
>     std.bitmanip.append!T(buf[], val);
>     return buf;
> }
> ---

This should be:

ubyte[T.sizeof] toUbytes(T)(T val) @safe {
     ubyte[T.sizeof] buf;
     import std.bitmanip : append;
     append!T(buf[], val);
     return buf;
}


More information about the Digitalmars-d mailing list