Re: Is there an equivavlent to C# boxing in D?

2022-02-11 Thread H. S. Teoh via Digitalmars-d-learn
On Sat, Feb 12, 2022 at 12:27:34AM +, IGotD- via Digitalmars-d-learn wrote: > If you want to store a value type on the heap in D you just use "new" > and a pointer to the type. The same thing in C# would be to wrap the > value type into an object. However when you do that automatic >

Is there an equivavlent to C# boxing in D?

2022-02-11 Thread IGotD- via Digitalmars-d-learn
If you want to store a value type on the heap in D you just use "new" and a pointer to the type. The same thing in C# would be to wrap the value type into an object. However when you do that automatic conversion without a cast seems not to be possible (C# also have a dynamic type that might

Re: How to work with hashmap from memutils properly?

2022-02-11 Thread Era Scarecrow via Digitalmars-d-learn
On Friday, 11 February 2022 at 02:43:24 UTC, Siarhei Siamashka wrote: Though this strange benchmark is testing performance of an LRU with ... wait for it ... 10 elements, which makes using hashmap/dict/AA a completely ridiculous idea. Hmmm... if it's static data i can see maybe a enum

Re: How to work with hashmap from memutils properly?

2022-02-11 Thread Sergey via Digitalmars-d-learn
On Friday, 11 February 2022 at 02:43:24 UTC, Siarhei Siamashka wrote: On Thursday, 10 February 2022 at 20:39:45 UTC, Sergey wrote: Code could be found here: https://github.com/cyrusmsk/lang_benchmark/tree/main/lru/source/d_comparison/mem Is this an attempt to implement a high performance