Re: Why is DList insertion log n?

2025-02-16 Thread Richard (Rikki) Andrew Cattermole via Digitalmars-d-learn
On 17/02/2025 11:55 AM, Andy Valencia wrote: Apparently this link on the doc web page is how you submit an issue: https://issues.dlang.org/enter_bug.cgi? bug_file_loc=http%3A%2F%2Fdlang.org/phobos/ &component=phobos&op_sys=All&priority=P3&product=D&rep_platform=All&short_desc=%5Bstd.container.

Re: Why is DList insertion log n?

2025-02-16 Thread Jonathan M Davis via Digitalmars-d-learn
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/std/container/dlist.d#L784) > I would say it is O(1), as you expecte

Re: Get parent function of nested delegate

2025-02-16 Thread Inkrementator via Digitalmars-d-learn
On Sunday, 16 February 2025 at 07:38:09 UTC, Anonymouse wrote: How can I make this work? As a workaround, you can define a useless symbol and get the parent of that. ``` module foo; void bar(string s, int i) { assert(__FUNCTION__ == "foo.bar"); alias parentModule = __traits(parent, m

Re: Why is DList insertion log n?

2025-02-16 Thread monkyyy via Digitalmars-d-learn
On Sunday, 16 February 2025 at 18:46:56 UTC, Ian wrote: Hi, I'm looking at the double linked list in std.containers and it says that insertion in front or back are O(log n). How come they are not O(1) ? https://dlang.org/phobos/std_container_dlist.html#.DList.insertFront Also, is this quest

Re: Why is DList insertion log n?

2025-02-16 Thread Andy Valencia via Digitalmars-d-learn
On Sunday, 16 February 2025 at 20:57:58 UTC, rkompass wrote: I'm looking at the double linked list in std.containers and it says that insertion in front or back are O(log n). How come they are not O(1) ? From the source code at [https://github.com/dlang/phobos/blob/master/std/container/dlist.d#

Re: implicit cast and overload priority

2025-02-16 Thread ShadoLight via Digitalmars-d-learn
On Sunday, 16 February 2025 at 05:39:07 UTC, Jonathan M Davis wrote: _especially_ when VRP comes into play, because then you get nonsense like foo(1) calling the bool overload. I have often seen this mentioned, but I only see this happen if there *isn't* an integer overload i.e. this... ``

Re: when should ranges be static

2025-02-16 Thread Inkrementator via Digitalmars-d-learn
On Saturday, 15 February 2025 at 19:21:33 UTC, monkyyy wrote: On Saturday, 15 February 2025 at 11:47:58 UTC, Inkrementator wrote: Would you expect that style change would remove this flavor of bugs? Do you think this is a compiler bug? It looks similar to this: https://github.com/dlang/dmd/issu

Re: implicit cast and overload priority

2025-02-16 Thread Jonathan M Davis via Digitalmars-d-learn
On Sunday, February 16, 2025 4:54:46 AM MST ShadoLight via Digitalmars-d-learn wrote: > On Sunday, 16 February 2025 at 05:39:07 UTC, Jonathan M Davis > wrote: > > _especially_ when VRP comes into play, because then you get > > nonsense like foo(1) calling the bool overload. > > > > I have often se

Why is DList insertion log n?

2025-02-16 Thread Ian via Digitalmars-d-learn
Hi, I'm looking at the double linked list in std.containers and it says that insertion in front or back are O(log n). How come they are not O(1) ? https://dlang.org/phobos/std_container_dlist.html#.DList.insertFront Also, is this question more for "General"? I'm a "new user" and "learning"

Re: Why is DList insertion log n?

2025-02-16 Thread rkompass via Digitalmars-d-learn
On Sunday, 16 February 2025 at 18:46:56 UTC, Ian wrote: Hi, I'm looking at the double linked list in std.containers and it says that insertion in front or back are O(log n). How come they are not O(1) ? https://dlang.org/phobos/std_container_dlist.html#.DList.insertFront Also, is this quest