How to compile with GtkD

2022-01-12 Thread Marc Charboneau via Digitalmars-d-learn
https://forum.dlang.org/post/uyfdddxuqartpcxwc...@forum.dlang.org On Sunday, 9 February 2020 at 12:03:23 UTC, Ron Tarrant wrote: On Sunday, 9 February 2020 at 11:52:19 UTC, mark wrote: right now I want to start on Linux and I'm stuck. Maybe this will help... https://gtkdcoding.com/2019/03/31

Re: Static indexing

2022-01-12 Thread H. S. Teoh via Digitalmars-d-learn
On Wed, Jan 12, 2022 at 11:04:59AM -0500, Steven Schveighoffer via Digitalmars-d-learn wrote: > On 1/12/22 3:59 AM, JG wrote: [...] > >     struct Point > >     { > >   double x; > >   double y; > >   alias expand = typeof(this).tupleof; > >   alias expand this; > >     } [.

Re: Static indexing

2022-01-12 Thread Steven Schveighoffer via Digitalmars-d-learn
On 1/12/22 3:59 AM, JG wrote: Hi, I want to make a type which has two fields x and y but can also be indexed with [0] and [1] checked at compile time. Is the following reasonable / correct?     struct Point     {   double x;   double y;   alias expand = typeof(this).tupleof;

Re: Static indexing

2022-01-12 Thread Ali Cehreli via Digitalmars-d-learn
On 1/12/22 00:59, JG wrote: > I want to make a type which has two fields x and y but can > also be indexed with [0] and [1] checked at compile time. std.typecons.Tuple already does that. You can add "member functions" like foo() below by taking advantage of UFCS: import std.typecons; alias P

Re: error: rvalue constructor and a copy constructor

2022-01-12 Thread vit via Digitalmars-d-learn
On Wednesday, 12 January 2022 at 08:04:19 UTC, vit wrote: Hello, I have this code: ```d [...] run.dlang.io has old version of dmd-beta/dmd-nightly with bug

Static indexing

2022-01-12 Thread JG via Digitalmars-d-learn
Hi, I want to make a type which has two fields x and y but can also be indexed with [0] and [1] checked at compile time. Is the following reasonable / correct? struct Point { double x; double y; alias expand = typeof(this).tupleof; alias expand this; } un

Re: Starting and managing threads

2022-01-12 Thread Bagomot via Digitalmars-d-learn
Good day! I keep giving rise to problems. Above, Tejas helped me a lot, but still doesn't work. I gave up using the fswatch library, thinking that the problem was in it. Now trying to do it using libasync. Here is the code that runs on the main thread, it blocks further actions on that thread.

error: rvalue constructor and a copy constructor

2022-01-12 Thread vit via Digitalmars-d-learn
Hello, I have this code: ```d import core.lifetime : move, forward; import std.stdio : writeln; struct Foo{ int i; static auto make(int i){ Foo tmp; tmp.i = i; return move(tmp); } this(scope const ref typeof(this) rhs){ this.i = rhs.i; w