Ah, so it's about lvalues an rvalues, not the type of the range.
Makes sense now.
On Tuesday, 26 December 2017 at 22:33:54 UTC, WebFreak001 wrote:
BigEndian is default btw, you don't need to specify that but
you can if you want.
Dealing with Endianness bugs has been such a pain, I like to be
On Tuesday, 26 December 2017 at 21:45:29 UTC, Dennis wrote:
I was trying to translate this kind of C code to D:
void calc(unsigned char *buf) {
(...)
res = read_u32_be(&buf[i]);
}
So I tried this:
import std.bitmanip : read, Endian;
void calc(ubyte[] buf) {
(...)
res = read!(uint, Endi
I was trying to translate this kind of C code to D:
void calc(unsigned char *buf) {
(...)
res = read_u32_be(&buf[i]);
}
So I tried this:
import std.bitmanip : read, Endian;
void calc(ubyte[] buf) {
(...)
res = read!(uint, Endian.bigEndian)(buf[i..$]);
}
But then I get this error:
templ