On Friday, April 15, 2016 21:16:44 Jonathan M Davis via Digitalmars-d wrote:
> On Thursday, April 14, 2016 09:31:25 Steven Schveighoffer via Digitalmars-d
>
> wrote:
> > That is awful.
> >
> > I propose we make slicing such a return value implicitly an error. I
> > can't think of a valid reason
On Thursday, April 14, 2016 09:31:25 Steven Schveighoffer via Digitalmars-d
wrote:
> That is awful.
>
> I propose we make slicing such a return value implicitly an error. I
> can't think of a valid reason for allowing it.
>
> I'm not the only one: https://issues.dlang.org/show_bug.cgi?id=12625
On Thursday, 14 April 2016 at 13:31:25 UTC, Steven Schveighoffer
wrote:
That is awful.
I propose we make slicing such a return value implicitly an
error. I can't think of a valid reason for allowing it.
I'm not the only one:
https://issues.dlang.org/show_bug.cgi?id=12625
-Steve
On Thursday, 14 April 2016 at 13:30:42 UTC, Daniel Kozak wrote:
On Thursday, 14 April 2016 at 13:08:56 UTC, Carlin wrote:
On Thursday, 14 April 2016 at 10:29:43 UTC, ag0aep6g wrote:
[...]
Thanks, that works perfectly! I couldn't figure it out and I
knew I had to be missing something really
On 4/14/16 6:29 AM, ag0aep6g wrote:
On 14.04.2016 12:14, Carlin wrote:
import std.stdio;
import std.bitmanip;
ubyte[] serialize(uint t)
{
ubyte[] bytes = nativeToBigEndian(t);
return bytes;
}
void main()
{
writeln(serialize(0));
}
Your code is wrong. It's really easy to get
On Thursday, 14 April 2016 at 13:08:56 UTC, Carlin wrote:
On Thursday, 14 April 2016 at 10:29:43 UTC, ag0aep6g wrote:
[...]
Thanks, that works perfectly! I couldn't figure it out and I
knew I had to be missing something really basic. I still don't
understand though why it works in release
On Thursday, 14 April 2016 at 10:29:43 UTC, ag0aep6g wrote:
On 14.04.2016 12:14, Carlin wrote:
import std.stdio;
import std.bitmanip;
ubyte[] serialize(uint t)
{
ubyte[] bytes = nativeToBigEndian(t);
return bytes;
}
void main()
{
writeln(serialize(0));
}
Your code is wrong.
On 14.04.2016 12:14, Carlin wrote:
import std.stdio;
import std.bitmanip;
ubyte[] serialize(uint t)
{
ubyte[] bytes = nativeToBigEndian(t);
return bytes;
}
void main()
{
writeln(serialize(0));
}
Your code is wrong. It's really easy to get wrong, though. Too easy
probably.
I have encountered a weird error that only seems to occur when
building in debug mode. In release everything works fine. I
wanted to post here before raising a new issue in case I'm just
horribly blind at what is happening here.
---
import std.stdio;
import std.bitmanip;
ubyte[]