Re: Why does is the RandomAccessInfinite interface not a valid RandomAccessRange?

2021-12-19 Thread D Lark via Digitalmars-d-learn
On Sunday, 19 December 2021 at 00:07:46 UTC, Paul Backus wrote: On Saturday, 18 December 2021 at 19:48:00 UTC, D Lark wrote: Can someone please tell me if this is expected behaviour and what the reasoning is behind this choice? Looks like a bug. I've filed a report on the D issue tracker: htt

FreeBSD 13 : wrong kernel version and size of kevent_t

2021-12-19 Thread eugene via Digitalmars-d-learn
test program: ```d import std.stdio; import core.sys.freebsd.config; import core.sys.freebsd.sys.event; void main(string[] args) { writefln("FreeBSD_version = %s", __FreeBSD_version); writefln("sizeof(kevent_t) = %s", kevent_t.sizeof); } ``` output: @bsd:~/d> ./freebsdver FreeB

Re: Why does is the RandomAccessInfinite interface not a valid RandomAccessRange?

2021-12-19 Thread Bastiaan Veelo via Digitalmars-d-learn
On Sunday, 19 December 2021 at 09:19:31 UTC, D Lark wrote: Do you know if there's a nightly version I can specify to use your fix? Are you inheriting from `RandomAccessInfinite`? Then you can probably add ```d static if (__VERSION__ < 2099) enum bool empty = false; ``` to make it work.

Re: Why does is the RandomAccessInfinite interface not a valid RandomAccessRange?

2021-12-19 Thread MoonlightSentinel via Digitalmars-d-learn
On Sunday, 19 December 2021 at 09:19:31 UTC, D Lark wrote: Do you know if there's a nightly version I can specify to use your fix? Nightly builds are available at https://github.com/dlang/dmd/releases/tag/nightly.

Re: ImportC: Should this compile?

2021-12-19 Thread bachmeier via Digitalmars-d-learn
On Sunday, 19 December 2021 at 02:57:35 UTC, Mike Parker wrote: On Saturday, 18 December 2021 at 22:31:38 UTC, bachmeier wrote: I've been trying to get the stb header library to compile. There's a single remaining failure: ``` typedef struct { unsigned char c[4]; } stb_easy_font_color; stb_

dynamic array + copy ctor

2021-12-19 Thread vit via Digitalmars-d-learn
Hello, Why is copy ctor in this example not called? ```d import std.stdio; struct Foo { int i; this(int i){ this.i = i; writeln("init: ", i); } this(ref typeof(this) rhs){ this.i = rhs.i; writeln("copy: ", i); } ~this() { writeln(

Re: dynamic array + copy ctor

2021-12-19 Thread Stanislav Blinov via Digitalmars-d-learn
On Sunday, 19 December 2021 at 22:29:21 UTC, vit wrote: Hello, Why is copy ctor in this example not called? Because D runtime isn't properly married to copy constructors yet. I.e. it's a bug, a variant of this one: https://issues.dlang.org/show_bug.cgi?id=20879

Re: dynamic array + copy ctor

2021-12-19 Thread Tejas via Digitalmars-d-learn
On Sunday, 19 December 2021 at 22:29:21 UTC, vit wrote: Hello, Why is copy ctor in this example not called? ```d import std.stdio; struct Foo { int i; this(int i){ this.i = i; writeln("init: ", i); } this(ref typeof(this) rhs){ this.i = rhs.i; w