Re: Limits of implicit conversion of class arrays

2024-03-25 Thread Per Nordlöw via Digitalmars-d-learn
On Saturday, 23 March 2024 at 11:04:04 UTC, Dmitry Olshansky wrote: The first and second is unsound (infamously allowed in Java). In the general case, yes. But, do you see any errors with the code ```d class Base {} class Derived : Base {} @safe pure nothrow unittest { Base b;

Re: Why is this code slow?

2024-03-25 Thread rkompass via Digitalmars-d-learn
On Sunday, 24 March 2024 at 23:02:19 UTC, Sergey wrote: On Sunday, 24 March 2024 at 22:16:06 UTC, rkompass wrote: Are there some simple switches / settings to get a smaller binary? 1) If possible you can use "betterC" - to disable runtime 2) otherwise ```bash --release --O3 --flto=full -fvisib

Re: Can a D library have some types determined by the client program?

2024-03-25 Thread Liam McGillivray via Digitalmars-d-learn
On Thursday, 7 March 2024 at 22:18:40 UTC, Richard (Rikki) Andrew Cattermole wrote: There are two ways to do this. 1. Use templates. https://tour.dlang.org/tour/en/basics/templates Thank you for teaching me how to do this. This is where I first learned to use templates in D, and I have been

Re: How do I use libdparser, or any library for editing D code?

2024-03-25 Thread Liam McGillivray via Digitalmars-d-learn
Unfortunately there's no "edit" option here, but the library I was referring to is actually "libdparse".

Re: How to use eventcore write an echo server?

2024-03-25 Thread electricface via Digitalmars-d-learn
On Thursday, 14 March 2024 at 18:49:54 UTC, Dejan Lekic wrote: On Tuesday, 12 March 2024 at 05:13:26 UTC, zoujiaqing wrote: How to fix it? than you ;) Try the following: ``` class Connection { StreamSocketFD client; ubyte[1024] buf = void; // Add these two lines befo

Re: Reworking the control flow for my tactical role-playing game

2024-03-25 Thread harakim via Digitalmars-d-learn
On Saturday, 23 March 2024 at 22:37:06 UTC, Liam McGillivray wrote: ...a tick system would go hand-in-hand with making animations happen in a separate thread, but it sounds like you're talking about the same thread. Are you suggesting a fixed framerate? I have done both ways. If you're new to pr