August 05, 2020 General » Re: ubyte[] to string with @nogc - different behaviors | |||
|---|---|---|---|
| |||
Maybe with a ref parameter, but I think this will only move the problem outside... | |||
August 05, 2020 General » Re: ubyte[] to string with @nogc - different behaviors | |||
|---|---|---|---|
| |||
...what I can tell -- bytes[] returns a ubyte[]. If this were std.container.array.Array... | |||
August 05, 2020 General » Re: ubyte[] to string with @nogc - different behaviors | |||
|---|---|---|---|
| |||
...It returns the first ubyte in the `buffer`. Once read, the ubyte is deleted from... | |||
August 05, 2020 General » Re: ubyte[] to string with @nogc - different behaviors | |||
|---|---|---|---|
| |||
...The different behavior is due to `read!ubyte` which removes the byte from the buffer... | |||
August 05, 2020 General » Re: ubyte[] to string with @nogc - different behaviors | |||
|---|---|---|---|
| |||
...of this function. What does buffer.read!ubyte do? If you have a more descriptive... | |||
August 05, 2020 General » Re: ubyte[] to string with @nogc - different behaviors | |||
|---|---|---|---|
| |||
You just leaked str_ptr there. It gets overwritten by bytes' ptr. I imagine what... | |||
August 05, 2020 General » ubyte[] to string with @nogc - different behaviors | |||
|---|---|---|---|
| |||
...ref const(ubyte)[] buffer) @nogc nothrow
{
Array!ubyte bytes;
ubyte b = buffer.read!ubyte();
while... | |||
August 03, 2020 General » Re: How to get to a class initializer through introspection? | |||
|---|---|---|---|
| |||
...too. Like
struct A {
int a = 10;
ubyte[10000] b = void;
int c = 20;
}
Could... | |||
August 03, 2020 General » Re: How to get to a class initializer through introspection? | |||
|---|---|---|---|
| |||
...Eh, what if you did
class A {
ubyte[__traits(classInstanceSize, A)] recursive;
}
it gives a... | |||
August 02, 2020 Learn » Re: 2-D array initialization | |||
|---|---|---|---|
| |||
...struct Color {
ubyte r;
ubyte g;
ubyte b;
}
// Assumes data is one ubyte per line... | |||
Copyright © 1999-2021 by the D Language Foundation