My Long Term Vision for the D programming language

Robert Schadek rburners at gmail.com
Wed Jan 5 09:34:16 UTC 2022


On Tuesday, 16 November 2021 at 21:00:48 UTC, Robert Schadek 
wrote:

> This can be fixed quite easily as well:
>
> ```D
> private auto someFunIR(R)(R r) { ... }
>
> private auto someFunRAR(R)(R r) { ...  }
>
> auto somFun(R)(R r) {
> 	static if(isInputRange!R) {
> 		someFunIR(r);
> 	} else static if(isRandomAccessRange!R) {
> 		someFunRAR(r);
> 	} else {
> 		static assert(false, "R should be either be an "
> 				~ "InputRange but " ~ inputRangeErrorFormatter!R
> 				~ "\n or R should be an RandomAccessRange but "
> 				~ randomAccessRangeErrorFormatter!R
> 				~ "\n therefore you can call " ~ __FUNCTION__);
> 	}
> }
> ```

Actually done and announced here
https://forum.dlang.org/thread/clyiounnxlnupinbafpy@forum.dlang.org




More information about the Digitalmars-d mailing list