question about using std.bitmanip.read

Mike Parker via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Fri Nov 6 20:21:44 PST 2015


On Saturday, 7 November 2015 at 03:19:44 UTC, Charles wrote:
> Hi guys,
>
> It's me again... still having some issues pop up getting 
> started, but I remain hopeful I'll stop needing to ask so many 
> questions soon.
>
> I'm trying to use std.bitmanip.read; however, am having some 
> issues using it. For basic testing I'm just trying to use:
>
>     read!double(endianess, ubyteArr).writeln;
>
> endianess is an Endian from std.system, and ubyteArr is an 8 
> byte ubyte[].
>
> When I run this I get:
>
> Error: template std.bitmanip.read cannot deduce function from 
> argument types !(double)(Endian, ubyte[]), candidates are:
>     std.bitmanip.read(T, Endian endianness = Endian.bigEndian, 
> R)(ref R range) if (canSwapEndianness!T && isInputRange!R && 
> is(ElementType!R : const(ubyte)))
> dmd failed with exit code 1.
>

You're passing endianess as a function argument, but the 
signatures in the error says it's supposed to be a template 
argument. Did you try this?

read!(double, endianess)(ubyteArr);



More information about the Digitalmars-d-learn mailing list