On Monday, 11 December 2023 at 23:21:45 UTC, Quirin Schroll wrote:
I always thought you had to provide aliases with all 16
combinations of the attributes `@safe`, `@nogc`, `pure`, and
`nothrow` for each actually desired instance. But you don’t and
**I have no clue why**.
Why does it work?
On Monday, 11 December 2023 at 23:21:45 UTC, Quirin Schroll wrote:
[…]
1. Instead of implementing a function `opApply(scope int
delegate(...))`, write a function template
`opApplyImpl(DG)(scope int delegate(...))` (or whatever name)
and let it take the delegate type as a template type
In an attempt to come up with an [answer to a
post](https://forum.dlang.org/post/dnsuyvnfcszwefsfz...@forum.dlang.org), I found something odd, but useful, that I nonetheless don’t understand.
As far as I know – or rather thought I knew – `foreach` loops can
infer the types of the “loop
Matches function declarations and captures function names from
`.d` Source Code file
**regexcapture.d**
```
import std.stdio : writeln;
import std.regex : matchAll, regex;
import std.file : read;
void main(){
string input = cast(string)read("sourcecode.d");
foreach(match;
On Monday, 11 December 2023 at 05:18:45 UTC, thinkunix wrote:
BoQsc via Digitalmars-d-learn wrote:
This is something I've searched on the forum and couldn't find
exact answer.
TLDR: `r"^."` is matching the very first two character in the
`input` string.
Don't you need two dots to match two