Re: Why is DList insertion log n?

2025-02-17 Thread Ian via Digitalmars-d-learn
On Sunday, 16 February 2025 at 20:57:58 UTC, rkompass wrote: From the source code at [https://github.com/dlang/phobos/blob/master/std/container/dlist.d#L784](https://github.com/dlang/phobos/blob/master/std/container/dlist.d#L784) I would say it is O(1), as you expected. So the docs you refer to

Re: Why is DList insertion log n?

2025-02-17 Thread Nick Treleaven via Digitalmars-d-learn
On Sunday, 16 February 2025 at 20:57:58 UTC, rkompass wrote: From the source code at [https://github.com/dlang/phobos/blob/master/std/container/dlist.d#L784](https://github.com/dlang/phobos/blob/master/std/container/dlist.d#L784) I would say it is O(1), as you expected. So the docs you refer to

Re: Names and design of partial sumtypes

2025-02-17 Thread monkyyy via Digitalmars-d-learn
On Saturday, 15 February 2025 at 19:49:59 UTC, monkyyy wrote: code ```d import std; struct nullable(T){ T get_; alias get_ this; bool isnull=false; int classify()=>isnull; enum classmax=2; alias get(int i=0)=get_; } unittest{ nullable!int foo; }

Re: implicit cast and overload priority

2025-02-17 Thread ShadoLight via Digitalmars-d-learn
On Sunday, 16 February 2025 at 17:04:39 UTC, Jonathan M Davis wrote: [..] Ok, gotcha. I suspected that is what you meant and agree with that (in my example an implicit match would more sense on 'long', not 'bool'). Thanks for the detailed answer.

Re: implicit cast and overload priority

2025-02-17 Thread ShadoLight via Digitalmars-d-learn
On Monday, 17 February 2025 at 09:33:32 UTC, mig09 wrote: On Monday, 17 February 2025 at 09:17:24 UTC, ShadoLight wrote: On Sunday, 16 February 2025 at 17:04:39 UTC, Jonathan M Davis wrote: [..] Ok, gotcha. I suspected that is what you meant and agree with that (in my example an implicit m

Re: implicit cast and overload priority

2025-02-17 Thread mig09 via Digitalmars-d-learn
On Monday, 17 February 2025 at 09:17:24 UTC, ShadoLight wrote: On Sunday, 16 February 2025 at 17:04:39 UTC, Jonathan M Davis wrote: [..] Ok, gotcha. I suspected that is what you meant and agree with that (in my example an implicit match would more sense on 'long', not 'bool'). Thanks for

Re: Why is DList insertion log n?

2025-02-17 Thread mig09 via Digitalmars-d-learn
On Monday, 17 February 2025 at 03:39:46 UTC, Jonathan M Davis wrote: On Sunday, February 16, 2025 1:57:58 PM MST rkompass via Digitalmars-d-learn wrote: From the source code at [https://github.com/dlang/phobos/blob/master/std/container/dlist.d#L784](https://github.com/dlang/phobos/blob/master/s