Re: foreach, RefCounted and non-copyable range

2021-01-19 Thread Fynn Schröder via Digitalmars-d-learn
On Monday, 18 January 2021 at 18:57:04 UTC, vitamin wrote: You need something like RefCountedRange with methods popFront, front, empty. Thanks! refRange from std.range does the trick, indeed.

foreach, RefCounted and non-copyable range

2021-01-17 Thread Fynn Schröder via Digitalmars-d-learn
I'm puzzled why RefCounted and foreach do not work well together, i.e.: ``` auto range = refCounted(nonCopyableRange); // ok foreach(e; range) // Error: struct is not copyable because it is annotated with @disable // do something ``` See https://run.dlang.io/is/u271nK for a full example w

Re: How to use libmir --> mir-algorithm, numir, mir-random?

2020-09-09 Thread Fynn Schröder via Digitalmars-d-learn
On Wednesday, 9 September 2020 at 11:43:16 UTC, Fynn Schröder wrote: DMD v2.076 is ancient (almost 2 years old!) typo: its almost 3 years old

Re: How to use libmir --> mir-algorithm, numir, mir-random?

2020-09-09 Thread Fynn Schröder via Digitalmars-d-learn
On Wednesday, 9 September 2020 at 11:36:56 UTC, Shaleen Chhabra wrote: but i am unable to configure the libraries, have dmd v2.076.1 installed on my PC. DMD v2.076 is ancient (almost 2 years old!). Current is DMD 2.093.1. I can only recommend to download and install an up-to-date version of D

Re: static if else behavior and is type comparison

2016-03-11 Thread Fynn Schröder via Digitalmars-d-learn
On Friday, 11 March 2016 at 08:21:33 UTC, Ali Çehreli wrote: You mean 'else static if'. (Not your fault: I (and others) wish the compiler warned about this problem.) Thanks! Such an easy mistake.. You're right Ali, it would be nice if the compiler gave a warning :)

static if else behavior and is type comparison

2016-03-11 Thread Fynn Schröder via Digitalmars-d-learn
Hi all, I'm currently working on a small utility to control the EC (embedded controller) of my notebook. I need to call an external C library and choose different methods based on the desired return type. I came up with a solution based on type checking and static if - however I ran into a we