Starting and managing threads

2023-03-24 Thread Vino via Digitalmars-d-learn
https://forum.dlang.org/post/eeqqmlojlniiihgyb...@forum.dlang.org On Sunday, 16 January 2022 at 09:38:52 UTC, Bagomot wrote: The program does nothing probably because of that continue. (?) No, it does work inside the loop. So, the event loop is in a separate thread. What should happen when t

Re: Implicit type conversion depending on assignment

2023-03-24 Thread Jacob Shtokolov via Digitalmars-d-learn
On Thursday, 23 March 2023 at 13:38:51 UTC, Alexander Zhirov wrote: Is it possible to convert such records inside the structure to the assigned type? ```d struct MyVal { string value; // Here it would be possible to use an alias to this, but it can only be used 1 time } auto a = MyVa

Re: Implicit type conversion depending on assignment

2023-03-24 Thread Jacob Shtokolov via Digitalmars-d-learn
On Friday, 24 March 2023 at 09:39:00 UTC, Jacob Shtokolov wrote: On Thursday, 23 March 2023 at 13:38:51 UTC, Alexander Zhirov wrote: Is it possible to convert such records inside the structure to the assigned type? BTW, you can also `alias this` your struct value and then use `std.conv : to`

Re: Implicit type conversion depending on assignment

2023-03-24 Thread Alexander Zhirov via Digitalmars-d-learn
On Friday, 24 March 2023 at 09:46:26 UTC, Jacob Shtokolov wrote: BTW, you can also `alias this` your struct value and then use `std.conv : to` for casting, if you don't need specific casting rules. I don't quite understand what you mean? Could you show me an example?

Re: Implicit type conversion depending on assignment

2023-03-24 Thread Jacob Shtokolov via Digitalmars-d-learn
On Friday, 24 March 2023 at 09:59:47 UTC, Alexander Zhirov wrote: On Friday, 24 March 2023 at 09:46:26 UTC, Jacob Shtokolov wrote: BTW, you can also `alias this` your struct value and then use `std.conv : to` for casting, if you don't need specific casting rules. I don't quite understand what

Re: Implicit type conversion depending on assignment

2023-03-24 Thread bachmeier via Digitalmars-d-learn
On Thursday, 23 March 2023 at 13:38:51 UTC, Alexander Zhirov wrote: Is it possible to convert such records inside the structure to the assigned type? ```d struct MyVal { string value; // Here it would be possible to use an alias to this, but it can only be used 1 time } auto a = MyVa

Re: Implicit type conversion depending on assignment

2023-03-24 Thread bachmeier via Digitalmars-d-learn
On Friday, 24 March 2023 at 13:53:02 UTC, bachmeier wrote: On Thursday, 23 March 2023 at 13:38:51 UTC, Alexander Zhirov wrote: Is it possible to convert such records inside the structure to the assigned type? ```d struct MyVal { string value; // Here it would be possible to use an alia

Re: better video rendering in d

2023-03-24 Thread Guillaume Piolat via Digitalmars-d-learn
On Tuesday, 21 March 2023 at 16:57:49 UTC, monkyyy wrote: My current method of making videos of using raylib to generate screenshots, throwing those screenshots into a folder and calling a magic ffmpeg command is ... slow. Does anyone have a demo or a project that does something smarter (or w

Re: better video rendering in d

2023-03-24 Thread Guillaume Piolat via Digitalmars-d-learn
On Friday, 24 March 2023 at 15:41:36 UTC, Guillaume Piolat wrote: Hi, The idea to pipe stdout to ffmpeg is sound. In the following dead repo: https://github.com/p0nce/y4m-tools you will find a tool that capture a shader, format it into Y4M and output on stdout. Y4M output is useful because

Step by step tutorials for using bindings in D

2023-03-24 Thread eXodiquas via Digitalmars-d-learn
Hello everyone, once again, I am here for your help. My last questions were answered really competently so I try again. :P So, maybe this is a stupid question, but I have read a lot about Bindings to C and C++ libraries for D. For example the Derelict project (or now [BindBC](https://github.

Re: Implicit type conversion depending on assignment

2023-03-24 Thread Salih Dincer via Digitalmars-d-learn
On Thursday, 23 March 2023 at 13:38:51 UTC, Alexander Zhirov wrote: ```d struct MyVal { string value; // Here it would be possible to use an alias to this, but it can only be used 1 time } auto a = MyVal("100"); auto b = MyVal("11.2"); int MyInt = a;// Implicitly convert to ta

Segfault with std.variant

2023-03-24 Thread Mitchell via Digitalmars-d-learn
Howdy, I've just tried out `std.variant` and I've noticed that I can induce a segfault by having a variant of variants. Should this work? ```d import std.stdio; import std.variant; void main() { Variant variant = Variant([ "one": Variant(1), "two": Variant(2), "three": Variant(